“Life expectancy in 1900 was 40 years, now it is almost 80 years in the USA.
You get one or more whole generations of life now than back then, and usually pain-free life.”
The difference in life expectancy is mostly attributable to a large decrease in child mortality, and the fact that mothers do not die in childbirth very often. The length of time people live isn’t really much longer now than it was back then.
That is how life expectancy of populations increases initially.
Then, as the society is more advanced, advances in adult chronic diseases start to make more of a difference, as it did especially in the 1960s until the present day.
Who started keeping the babies from dying in infancy? Who started keeping the mothers alive in childbirth?
Any way you cut it, it is advances in one or another branch of (mostly American) medicine, or (mostly American) medical science and technology, plus the efforts of (mostly American) health care workers.
All of which operated in the context of the American free enterprise system.