my guess is that you probably use a mix of the two, because that's how i write my songs too. but are there any specific tips you have just for writing these short jingles?  sorry for the long and winding question
you just have to magically think of them, just the same way you can magically think of the words you use when you talk. i don't know exactly how we do that, but i know that you get better the more you familiarize yourself with the playing field. so, for language, we just spend a lot of years in the world listening to people talk and trying to do it ourselves. for music, you can spend a lot of years listening to music and playing around with your favorite instruments. Also, because songwriting involves language, it can be helpful to spend a lot of time free-writing