Uhm... I come up with something, record it and start figuring out if I got something laying around that fits with it. I tend to have numerous guitarparts recorded, and lyrics written down, at any given time that I don't really have any use for, so it just becomes a big puzzle after a while... It's like... I know I have something here that will fit into whatever I'm doing at the moment, but I just can't seem to find it.
Should catalog it better.
Never written music for a piece of lyrics, though. I've had lyrics laying around that has fitted something written later, but it has never been intentional.