Sometimes song happens all at once where you sit down and the lyrics and the music just come out. So there definitely isn't one way that it happens - there are a lot of different things that take place.
Seeking happiness in material things is a sure way of being unhappy.