Many countries around the world have large public pension programs. Traditionally, these programs have been used to induce retirement by the elderly in order to free up jobs for the young and to redistribute income across generations. This paper provides an efficiency rationale for the inter-generational income redistribution focus of such programs in a framework which explicitly accounts for the role of the lifecycle as well as search and matching frictions in the labor market. In our model, public pension programs alter the age composition of the labor force by inducing the jobless elderly to retire. By requiring a long history of labor market attachment in order to receive benefits, these programs raise the future value of current employment for the young which serves to redistribute bargaining power, and hence income, from the young to the old. This form of cross-cohort redistribution is an important, yet neglected, dimension in the ongoing debate about social security reform.