I'd say that most of the time, the title is derived from the strongest and most memorable part, usually found in the chorus lyric. This is at least true for most modern pop productions. You can also take the approach of naming a song and writing lyrics to it, but it's helpful to change the title further down the writing process if a better title can be derived from lyrics.