I suppose forts are there, in the most fundamental sense, to control territory. The gamey idea of a fort having a 'zone of control' is probably not that far-off from the strategic reality.
In tactical terms, a fort is a system of artificial obstacles that marks out a space where enemies will have to devote outsize effort into taking. So generally speaking, being inside a fort generally grants more protection than being outside of a fort.
This attribute makes forts the ideal place to protect vulnerable things from the enemy. Of course there are other ways of protecting vulnerable things - hiding or dispersing them, for example - but there are some things that can't just be kept hidden or dispersed from the enemy. These things include local administration, supply caches, populations, and so on.
In the most extreme cases - like a nomad vs. settled conflict - failing to protect your administration/supplies/people essentially resets your control over the land to 0 every time an enemy invades and these things get physically eradicated/taken away. On the other hand, a successful fort ensures that once the enemy is gone, you still possess the infrastructure to quickly re-assert your original control over the land. It's obviously a bit more qualified in settled vs. settled conflicts, but basically in strategic terms possessing a fort grants permanence to your control of the land (which can be defined in terms of control over population, strategic land, supply routes, etc.). This contrasts starkly with the invading enemy whose control over the land is entirely contingent on the physical presence + local superiority of his forces.
Why is permanent control better than contingent control? Because when you permanently control land, the status quo defaults in your favor. So the enemy has to actively work against you (siege, subterfuge, etc.) and deploy more resources than you in order to wrest control of the land. And in a world where resources are finite and thousands of competing priorities exist, that means that the enemy (whose control over the land is only contingent, assuming he hasn't built forts of his own) faces a much harsher cost-benefit/opportunity cost analysis than you do and will thus be more tempted to give up/not attack you in the first place.
EDIT: I realize the title was fortifications, not forts, but I think the principle is largely the same, nonetheless. Of course, one can argue that a few city walls were made with non-military purposes in mind (like civic pride or class differentiation).