A model is developed explaining many common historical sequences: inter alia, the rise and fall of empires, expansion or contraction in the geographic size of nations, wars of secession, non-contested secessions, and growth of supra-national unions. The basic unit of analysis is a transaction in international (or national) law that verifies and legitimizes transformations from one organizational entity to another. Decision-makers for national, or super-national entities as well as those at sub-levels are assumed to be welfare maximizers under cost constraints. Potential secessionists face dispute costs, and decision-makers for the higher-level entity incur persuasion costs. Both costs may include military expenses. These transaction costs are shown to play a crucial role in determining the optimal number of independent countries in the world.