Nations form alliances so when war occurs or is on the brink they will have another nation to help defend themselves and confront their opponents, whether the war is verbal ( threatening words) or physical conflict. Alliances are just people they can depend on to have their back and in return they have theirs.
You can have national alliances, friendship alliances, family alliances, competitive alliances, corporate alliances, etc.