If someone else being better at something discourages you, you are going to have a bad time in life. Very few people are going to be the best at the world at anything, but that doesn’t matter. It doesn’t change what you can do.
It isn't so much discouragement. And it's a lot more like a great painter who would listen to a pianist masterpiece, and know very well achieving that level of skill in that totally different art field would be almost impossible = time is limited, would involve giving up the mastery or continue to improve in the visual artistry.
It isn't someone much better at something. It's someone much better at something entirely different yet quite related.
It doesn't change what one can do that's true. Comparison with oneself is mentally healthier for sure. But humans compare themselves with who they can see, the internet gives us a view of what virtually everyone is capable of.