Usually, it's something like this:
1. Random improvisational piano playing sporadically over the course of weeks. Every so often, something catches my ear and starts to become a regular thematic element in the improvisation.
2. I start writing lyrics. The radom thematic material from #1 often ends up being some part of the chords or intro, and the rest of it tends to be loosely related to it in sort of a theme & variations fashion.
3. I adjust the chords and overall feel until they fit the lyrics. Sometimes, I completely throw out the chords and melody and build something totally new under the lyrics. (These songs usually suck and end up never being recorded, though not always.) If necessary, the words change slightly to fit the revised chords and feel.
4. I play the song a couple of times a day for a month or so. During this, the chords get tweaked to further levels of refinement, intros and interludes get cleaned up, improved, rewritten, etc. Sometimes I'll throw in a bridge during this stage if I didn't do so before. Sometimes I'll add an extra chorus during this stage, either at the beginning or at the end.
5. I record.
6. I continue to periodically play it and adapt it slightly.
7. Three years later, I do the "live acoustic" cut. It sounds almost country.
8. Go to step 1.