We say about different musicians and others that they "have a good or terrific ear", or sometimes that a person has a "lousy" ear, and some unfortunate individuals are said to be tone deaf, that is, unable to hear any distinctions of musical pitch.
For musicians, a good ear is very important, for conductors, absolutely essential. To put it in an over simple way, musical tones consist of vibrations per second. The more vibrations per second, the higher the pitch, and vice versa. Each C or D etc when it sounds an octave higher is double the number of vibrations. A tuning fork sets the A above middle C on the piano at 440 vibrations per second. The A an octave below is 220, and so forth.
Some people have better sense of pitch than others. They can tell if something is obviously out of tune ; others lack this ability, or have it to a lesser degree. Those with absolute pitch, also called perfect pitch, can identify any note as A,B,B Flat, C, E, etc, if you , say, play it on a piano at random. I happen to have this ability. Not all musicians do, and it's not essential to be a fine musician, but it helps often, and it can also cause problems. Others have what is called relative pitch, that is, they may not be able to automatically hear what a pitch is, but they can relate other pitches to a note if they know what it is.
Some of the great composers have had absolute pitch, such as Mozart, but others have not, such as Stravinsky. It doesn't really matter in the long run for a composer; a lot of great music has been written by composers who lacked absolute pitch.
But pitch is not a constant thing ; it has varied over the centuries, from time and place. In general, around the time of Bach, Handel, Haydn, Mozart and Beethoven, a lower pitvh than A 440 was used, about a half tone lower, but it varied a great deal. Orchestras and solo instrumentntalists who use the pld, or period instruments tune to a lower pitch. This means that to some like me, when I hear a performance of a symphony by Mozart in the key of C major, it sounds like B major. This is why hearing these attempts to recreate the performance styles of the past can be doisconcerting (no pun intended ) at times. But I've found that my ear can adjust.
When I was studying music in college, I had to take what is known as "Ear Training " courses. We would have to sing melodies using solfeggio, or solfege in French. We used do, re mi etc to sing. It's important training. But it gave me difficulties because of my absolute pitch. I had no trouble singing the melodies per se, but it confused me in trying to remember the do re mi's etc. It was more comfortable just to sing the pitches. But those without absolute pitch need the solfege syllables.
Our brains are all wired differently ; we don't hear musical pitch in the same way. At rehearsals I attended as a horn player, conductors would correct intonation to try to make everthing in tune, sometimes another musician would tell me or others that we were too "sharp" or slightly above the note in pitch, or "flat", that is slightly below. Sometimes, musicians get into arguments over pitch, and resentment is caused. Some musicians take a small portable device which measures sharpness or flatness and shows variations in pitch. We musicians can't always tell how accurate our pitch is, even if we have first-rate ears. It's very relative ; you may seem in or out of tune compared to others playing at the same time.
Sometimes I have read reviews of live concerts or commercial recordings where the critic complaied of faulty intonation, yet I did not notice any. Other times, I have heard what sounded to me like faulty intonation art a concert or on a recording, and the reviewers did not find anything wrong.
Occaisionally, in complex atonal or twelve tone music that I have heard, my sense of pitch goes temporarily astray and I lose my sense of pitch temporarily and get confused.
But classical music always sounds best when it's in tune.