On NPC Packages there is a Flag (or a checkbox in the Package setup bits and pieces ... it's in one of the two places in the Package design, anyway!) that says "Allow Random Conversations" and/or Allow Random Greetings
You can also tie that to StoryManager (Activate NPC - or Hello Event, or something like that - is I think the event in SM) and tie that event to a number of Scenes in a MyTownQuest that you setup just for this purpose.
In that same quest, you can also have Dialogue-based conversations that trigger on certain events (as others have said, player near, stage of foriegn quest, time of day, day of week and so on). Either using wide criteria - so almost any one in town can say a line ("I heard Helgen was attacked by Dragons!") - or tight criteria that mean a particular type/class of NPC ("... until I took an arrow in the knee") or even two particular NPCs (like the Adrienne one, mentioned above by Doc)
Have a Look at the Khajiit Caravan Quests ... they have a set of random "scenes" that allow them to be active - with one another - when the player is in range.
The Execution Scene in Solitude is also worth a look (if you can find it, I forget which Quest it belongs to). And there's a beautifully designed little Scene the first time you enter Winterhold (between husband and wife, outside the pub) ... coc from Main Menu to Winterhold to see that one (best example of an apparently random conversation that the player walks into that I can think of, in the vanilla game ... well worth a look)
Basically:
- Think of each NPC you place in town as a character
- Think of a daily routine for him/her
- What is their job? Where do they work?
- Where do they live/sleep?
- Be even more sixy and vary that by Day or by Month (Saturday's off are spent hunting ... or in the pub!)
- Think of some other NPCs they might visit (maybe they are related, and visit every day/evening?)
- Do they have a spouse?
- Do they have kids?
- Cousins, aunts, uncles, brothers/sisters?
- When do they visit these ^^^^^^^ people? Do these people visit them?
- Do any of these people live in other towns? Or out in the country? (better get them a horse to go there on)
- Maybe they have a favourite shop (if they "haven't all been closed down"
) - or the Inn - that they go to hang out in at lunch?
- Think of some stories they may tell, or events happening in their life - and give them a couple of lines to say about it (triggered when they meet any - or a specific list of other - NPCs)
- If they are very special, make them part of scenes ... that trigger when you know the player is "watching" ... when the scene triggers, other actors will make their way over to join in (if you set it up like that)
- Use the PLAYER when you can (but not all of the time!) ... It's very nice to have the player wander into town and someone walk up to say, "Hey, you're new around here", or "Have you seen my little dog, Toto?" (and start quest ...)
All of that adds life to your place. And the more in-depth you are prepared to go (this takes hours and hours to do well) the more life-like it appears.
All of a sudden you walk into a town and it's suddenly like a real town, with people out and about, getting on with their own lives.
(This is my very favourite part of the CK ... You can - well
I can - have days and days of fun making up stuff that plays like an episode of a soap opera

)
A final tip: Have something atmospheric right by the gates ... the blacksmith shop in Whiterun is a brilliant example. As soon as you walk through the gates (at the right time of day) you get the hammer on anvil sounds (or the furnace, or the whet-wheel) and that helps it feel like a "real place, with life" the moment the player enters.
Note that many DefaultPackages help you out a lot ... you don't need to make every package yourself!Yes ... I should have bought The Sims!!
