Far and away most of my songs I write, I write both tune and words. In only a few have I used a preexisting tune.Now, as to when (normally) I'm creating both: Someone above suggested tune first, and words afterward. I know some like the reverse. Well, people have said I was odd for years, but I don't (normally) do either of those.
Usually, for me, the words of the first verse sort of come with a tune attached. Then of course subsequent verses have to follow that tune. The same kind of thing happens with the chorus, but where the main focus in writing that first verse was on the words, the main focus in creating the chorus tends to be on the tune, to contrast and yet work with the tune of the verse, which already exists at that point.
Once I start singing the song, however, everything tends to be up for grabs, and the tune is almost sure to be adjusted, and the words well may be.
Dave Oesterreich