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.
There were exceptions though. Military pensions had long been given to soldiers who had risked their lives (though those pensions didn't necessarily mean they could stop working altogether). In the United States, starting in the mid-1800s, certain municipal employees—firefighters, cops, teachers, mostly in big cities—started receiving public pensions, too, and in 1875, the American Express Company started offering private pensions. By the 1920s, a variety of American industries, from railroads to oil to banking, were promising their workers some sort of support for their later years.