Why does the retiree to contributor ratio matter when discussing the solvency of Social Security? Whenever the topic of Social Security solvency comes up, the consensus is that benefits for future generations have to be cut, mainly because of two reasons:


People are living longer.
There are more people retiring than people contributing to the system.


I understand the first reason, but the second doesn't make sense to me, mathematically speaking: the retirement of an older generation should not be affected by the number of contributors in the younger generation.

In simplistic terms, if the older generation is composed of 100 people, those 100 people paid payroll taxes during their working years, so by the time they retire, there should be 100 people's worth of reserves to fund their retirement. The number of contributors in the younger generation is irrelevant.

Inflation should not be a factor either since, at least in the United States, reserves are invested in intra-government bonds.

So, why do I constantly hear the retiree to contributor ratio as a reason why Social Security benefits will have to be cut for future generations?
Pay as you go vs Fully funded pension plan distinction is relevant here. Also known as Defined benefit vs Defined contribution. 

If everyone saved for their own pension via payroll taxes or otherwise (Pay as you go/ Defined contribution), then the ratio of retiring to contributing people indeed would not matter. 

However, most governments pay current retirees from taxes on current workers. If there are fewer current workers relative to retirees, then either each has to pay more tax (discouraging working, eventually leading to declining tax revenue) or each retiree gets less pension. Governments typically do not save the current taxes to pay pensions when the current workers retire. Instead, governments are typically borrowing against future tax revenue. 

See also the Overlapping Generations Model (OLG).