It seems like people, regardless of their knowledge or "sense" of harmony, can naturally tell which one is the main melody and which is the harmony in a song--even if the melody is never played alone (without harmony) in the song. I guess the melody will sound a little louder than the harmony, but besides that, what else goes into helping people naturally distinguish between the two?
- may be louder, or mixed 'drier'
- might be a distinct 'voice' type (e.g. male 'main' singer with 3 female backing singers)
- often changes note more often, while harmony notes may tend to change more 'with the chord'
- may be more inflected and ornamented
- may be freer in time, with the harmony following the beat more closely
- may be easier to follow as it can move in smaller steps than the harmony voices, which by contrast may have to move in bigger steps to follow the chord tones.
- will often be the one that 'lands' on the 'important notes' in the scale (e.g. root) at the end of passages.
As Scott and Todd point out in the comments, it's often the highest voice or lowest voice.
Another rather obvious point - sometimes the harmony only comes in during some passages, making it easier for the ear to focus on the thread of the main melody.
That said, there are harmonised parts where none of these are true and a single obvious melody doesn't really 'stick out'.
The human ability to feel melody has the same nature as ability to feel the speech intonation. The physiological experiments proved that contour of speech intonation is determined by current most perceiving frequency component in the diapason roughly 100-500 Hz. In the same time the summary diapason of bass and treble staves in which a melody is depicted stretches from 98 (G2) up to 698 Hz (F5), that is the diapasons are enough similar if take in the consideration the dependence of their estimation from multitude of factors. Therefore it is possible to suppose that feeling of melody is determined by current most perceiving frequency component of music sound in the diapason roughly 100-700Hz, which boundaries overwhelming majority of known melodies don't cross. The sensibility of ear increase continuously up to roughly 3500 Hz therefore strongest partial of most high note of chord forms in common case current melody pitch. However there are possible cases when thank to summing up of partials different chord notes the another stronger excitement arises and the brain should evaluate the pitch otherwise and sensible melody pitch deviates from pitch of the highest chord note. The second inversion triads are especially vulnerable. For example, the tonic note in the final authentic cadence is commonly doubled. Partly it is made in order to provide proper melody pitch. The table below presents in the MIDI scale pitches of notes and their most important partials in the last chord C4,E4,G4,C5 of the perfect authentic cadence. The note C4 doubles melody note C5 and 3 upper notes form major triad in second inversion.
If note C4 is absent then near second harmonic of the C5 and third harmonic of the E4 can form in the area of 83-84 more strong pitch then the only pitch 72 of C5 and melody would be distorted. The doubling of the melody note note prevents that.
Greetings Yuri Vilenkin