As you may have noticed, people often sound like they have less of an accent (or sometimes none at all) when they sing in a foreign language. This holds true even if they have a noticeable accent when they speak in that languages, or even if they don’t know the foreign language at all. Why is this?
Well, first, let’s give a very short background explanation of accents in general. Two of the main factors that contribute to what we hear as an accent are: pronunciation of individual sounds (e.g. “th”), and its often overlooked partner in crime, intonation, or the melody of speech. When a foreign speaker pronounces a word or a sound incorrectly, that’s obvious; this is why most people think of an accent as merely a series of mispronunciations. However, there is actually a variety of complex and subtle factors at work that cause a native speaker to perceive somebody as having an accent. Intonation is a crucial but often overlooked aspect of speech and accentedness.
Now, back to the question of why people sound less accented when singing:
Intonation, cadence, rhythm, inflection, word stress, tone and pitch comprise a great part of what a listener perceives in a person’s speech. Intonation varies based on the type of sentence (e.g. in American English, a drop in pitch at the end of a statement, or a rise in pitch at the end of a question). It also varies based on the emotion of a sentence (e.g. changes in tone for surprise, anger, curiosity, sarcasm). However, intonation, melody and pitch of speech get rendered moot when someone is singing, because they simply use the melody of the song, rather than the subtle intonation patterns of speech that took the native speaker a lifetime to learn! The intonation of speech is displaced by the song’s melody and rhythm. Mistakes in pronunciation are still made, but it is easy for the ear to gloss over them in the absence of intonation differences, a key aspect of what comprises a foreign-sounding accent.
(Originally posted as an answer on Quora.)