If you exclude accidents or wars, life expectancy has been in the range of 40 to 100. There were kings who died naturally in their 40's despite all the healthcare they could afford. Also, those who did home medication living to 100 and beyond.
In the ancient times, cavemen lived to see their 40th birthday at the most. Food was scarce (before agriculture). Fight with animals would mean instant death. If injured, he or she would die in few days as there was no medication like antiseptic, antibiotics available.
Once the human being learnt agriculture, he did not have to struggle for food everyday. And living in societies reduced the conflicts with animals to a greater extent. This dramatically helped the human species lifespan. They began to live longer.
Then the development of medicines made things even better. It gave further boost to the lifespan.
Now, in today's age, there are two major factors affecting lifespan. Lifestyle & availability of healthcare facilities.
1. Lifestyle: This is about kind of food we eat, presence or absence of physical exercises, do we sleep enough or not, habits affecting physical or mental health etc. If you take good care of your health, you are expected to live longer and the opposite makes you more vulnerable.
2. Healthcare facilities: Though healthcare facility is present but it is not equally distributed across the world. Many Asian & African villages lack a hospital even today. Even if there is one, it may not be well equipped to serve the needs.
These two factors determine how long one lives. In Japan, average life expectancy is above 80 years. The highest in the world. And in many African countries, the number is below 50. Global average is 71 years. If you happen to live in India, life expectancy is just 2 years lesser than global average, 69 years. And it is gradually getting better. Another populous country, China, has a number in higher 70's (or close to 80).
Well, this is average number. There are always people living above and below this number, influencing the average. If you brush your teeth twice a day, you add two years to the average. If you chew tobacco, you need to subtract couple of years from the average to arrive at your lifespan. Variety of factors affect how long we live.
If you say philosophically, it is not the number of years but the quality of lie lived is more important, well, that is not the subject matter of this article, it would be another blog post.