There's this new thing called game theory.
Edit: Did not mean to sound rude, but it's been too long since i studied economics for me to feel confident explaining it in any detail, the jist of it though is: Let's say the alliance and horde have a peace agreement, because as you say all lose in war, if both keep the agreement they both benefit, if one of them breaks the agreement and the other follows through they will catch the other unprepared and gain territory and resources, but the other will be ravaged, and if you both break it both will be ravaged. The rational thing to do might be for both to keep the agreement, but since that's the rational thing for the first party the rational thing for the second party would be to break it ending up in a weird rock paper scissor style of reasoning most likely ending with the agreement broken.