Several fundamental reasons exist, as to why nations maintain defense forces.
The first fundamental reason as to why nations maintain defense forces is simply to protect/defend their people. This is as it should be: in a world where a nation without defense forces is rather exposed.
The second fundamental reason as to (some) nations maintain defense forces is to conquer other nations, and tap those other nations’ resources. Of course, some excuse is given for the attacks, but the real objective is always to plunder the resources.
The third fundamental reason as to why (some) nations maintain defense forces is to hire them out to other nations that require military power, in exchange for money. It is an unfortunate situation where a given nation’s defense forces are hired by another one (typically a stronger one) to fight in a proxy war for it, in order to help it achieve its strategic objectives. Then the leaders of the nation whose defense forces are used in that way are paid, and offered protection against their political opponents, and they become very happy. Meanwhile, the soldiers who are actually send on such proxy missions are not really told what they are fighting for or against, though most are usually bright enough to figure these things out on their own.