The text is written after the melody is finished — syllables and accents must fit the notes and rhythm of the melody.
Listen to the melody and replace 'la-la-la' with words. Watch where the melody rises (important word) and falls (line end, rhyme).
Melody has its own dynamics and emotion. When text fits the melody, it sounds natural.
Paul McCartney: 'Yesterday' — melody first, 'Scrambled eggs' as placeholder.