Pensions may be provided for in a modern society by a mix of several methods, namely by voluntary individual savings, mandatory fully-funded occupational pension systems, mandatory social security financed by pay-as-you-go, and old-fashioned hoarding in cash. Here, we call the specific mixture of the four systems the pension composition. We assume that individual workers decide on their own individual savings, that the fully-funded occupational system is decided upon by the age cohort of the median worker (MW), and that the social security is decided upon by the median voter (MV). In this behavioral approach we distinguish between several social groups, where individuals belong to several groups simultaneously and where the interests of the different groups are only partly coinciding. For a given demography and interest rate, the joint result of the decisions of the different age cohorts is a Pareto equilibrium. For ease of exposition we assume that individual and collective pension savings are the only sources of capital supply. When capital supply equals demand from industry there is equilibrium in the capital market with a corresponding equilibrium interest rate. In this paper we assume a demography with one hundred age brackets and we investigate how changes in the birth rates, survival rates, and the retirement age affect the pension composition and the capital market equilibrium. Our conclusion is that the demographic effects are considerable not only for the resulting pension composition but also for macro-economic variables such as the wage rate, the interest rate, and the capital-income ratio. It follows that the pension composition in general and social security in particular is determined by the demography and cannot be modified at will as a long-term political instrument. We find that this is relevant for the present century, where birth and mortality rates in most western countries are steeply declining.