In 1881 Otto von Bismarck, the conservative minister president of Prussia, presented a radical idea to the Reichstag: government-run financial support for older members of society. In other words, retirement. The idea was radical because back then, people simply did not retire. If you were alive, you worked—probably on a farm—or, if you were wealthier, managed a farm or larger estate.
But von Bismarck was under pressure, from socialist opponents, to do better by the people in his country, and so he argued to the Reichstag that "those who are disabled from work by age and invalidity have a well-grounded claim to care from the state.” It would take eight years, but by the end of the decade, the German government would create a retirement system, which provided for citizens over the age of 70—if they lived that long.
This was a big "if," at the time. That retirement age just about aligned with life expectancy in Germany then. Even with retirement, most people still worked until they died.
...
when the Social Security Act was passed in 1935, the official retirement age was 65. Life expectancy for American men was around 58 at the time.
Almost immediately after that, though, that balance changed. The Depression ended, and wealth and better medicine meant that in the post-war boom, Americans started to live longer. By 1960, life expectancy in America was almost 70 years. All of a sudden more people were living past the age where they had permission to stop working and the money to do it.
https://www.theatlantic.com/business/archive/2014/10/how-retirement-was-invented/381802/