Lord parties, castles, and towns regenerate troops automatically. Lords do so after they are defeated--they'll reappear in a town or castle and you'll see their numbers slowly increase. Once they reach a certain point it stops and they start roaming around. After this, they can augment their party by recruiting in towns or freeing prisoners after a battle. It seemed in previous versions, where you could actually see lords' wealth on the factions/lords screens, that the number and quality of troops was related to their wealth. Now wealth is hidden.
Castles and towns garrison slowly. When taken, they start with zero troops, but as soon as the castle or town is awarded to a lord as a fief, a small amount of troops will appear (larger for towns, and town garrisons seem to grow faster than castle garrisons). Over time they build up. It appears that they never stop--in my late .96 game, some towns have over 800 troops garrisoned. I've seen castles with 250+.