Forts are very usefull to delay invasions. Put them in a mountain pass or right next to a bridge and they will slow an invading enemy down for at least 1 turn (if he has no siege weapons). You don't even need a big force in them to accomplish that, a single peasant is sufficient.
Though, if you want to have your fort make a bigger impact, 5-8 mixed units (esp. missile troops) will give the enemy some resistance if they assault and can sally against small stacks.
The delay a fort gives the enemy gives you time to gather more adequate forces to handle the invasion.
Another usefull strategy is to have a fort with a single unit as garrison behind an army blocking a bridge, IF you get worsted at the bridge, your surviving troops will fall back into the fort, which the enemy will have to siege. The enemy has probably suffered quite some casualties breaking your bridge defense so you will have a second chance to beat him back. It might be wise to immediately retreat to the fort once you find you can't hold the bridge, cut your losses and run to fight another day.
an army can go around a fort without sieging, but that takes two turns- time to gather a counter attack.