We consider how the political system of the state evolves in the process of economic development. We present a dynamic public goods economy with non-overlapping generations, which confronts the free-rider problem without the state. In each generation, individuals enter under the unanimous rule a social contract of the political system, either monarchy or democracy, and then attempt to establish the state under the contracted political system. If the state is established, it provides public goods by enforcing tax on its members. Our game theoretic analysis shows: (i) the state can be established if and only if social productivity in terms of the capital stock of public goods is lower than a critical level; (ii) individuals choose democracy if social productivity is sufficiently high, while monarchy may be chosen if it is not; (iii) social productivity stochastically converges to the critical level over generations; and (iv) a simulation result shows several transformation patterns of political systems.