In war, allies are friends — specifically, friendly nations — you can trust. Allies are on your side.
The main meaning of this word comes from war. Without allies, a country is going to be all alone in a war. Like many other words of war, this term spread beyond the battlefield. A politician trying to pass a law is going to need allies, probably in both political parties. Any time there's a disagreement or conflict, it helps to have allies: if you don't, you're all alone.