Many elements behind our most recent NPCs have been randomly generated, and here's how we do it!
1. We come up with a general story or direction we'd like our cities / events to go in, and we create several characters to fill those cities and events with.
2. We think about what each of those characters would do in the cities/events, what their roles are, what they offer to the story as a whole, etc. We pick a race here, too, based on what we'd think would be coolest or most impacting.
3. Now that we have several very basic ideas of what we want, we use Marnok's NPC generator, which can be found here: http://marnok.com/content/_adventure/10