It depends on how the militant society developed. I can see there being that alliance if the militant society was originally part of the the peaceful one, say a warrior class that went to a different patch of land, with fewer natural resources, to train; various changes to society and laws over time could conceivably leave these two entities regarding themselves as separate states dependant upon each other. Or the militaristic group might have originally been bandits and mercenaries who after raiding the other country for years were offered a deal to stop and instead attack other nations, where they get resources in exchange, and this gradually developed to an alliance.