To keep this relatively simple, (i.e., without me doing LOTS of research to document and validate my recollection):
Malthus, an British economist, predicted widespread famine and disease would keep populations low. That did not occur. Why?
1) better medicine and health care; fewer deaths, especially of children.
2) better food production, especially by use of machinery and fertilizers, especially chemical fertilizers.
As someone with a bit knowledgeable of Chemistry, let me assert that the ability to take nitrogen out of the atmosphere and convert to ammonia and other forms of nitrogen accessible to most green plants is the key advancement. I think the Haber process converts H2 and N2 into NH3 as the starting point for this chemical process. I know that this reaction is studied extensively as a chemical reaction, especially as a Reaction Rate and Equilibrium case study. (The conditions to shift the Equilibrium to the ammonia, NH3, side is something studied in intro Chem courses; see Le Chatelier's Principle; also, read about the Haber chemical reaction if you want the in-depth Chemistry.)
Also see:
https://www.ias.ac.in/public/Volumes/reso/016/12/1159-1167.pdfAs far as medical care, one of the most important things that has kept babies alive is to provide CLEAN drinking water. This began in the USA in New Jersey around 1905-1910; the exact year escapes me. A similar effort was going on in Britain about the same time. Use of chlorine bleach (in the form of hypochlorite) to treat drinking water (and kill harmful bacteria) cut the death rate of babies by some 90% within one year of the start of use of this water treatment, again based on my memory of reading on this topic. I may have a few facts and # off, but the narrative is essentially valid.
Later there has been the GREEN Revolution of the 1970s with better seeds. Rice I think was key crop improved at that time. Now we have GMO seeds (that is a bit controversial, I know).
Of course, better sanitation and simple things like doctors washing their hands made a huge difference in cutting death rates. Use of anti-biotics came along later.
I know that the population of the world over is growing. The Population increase in the developed world has essentially stopped (or slowed significantly). China had its ONE CHILD only policy now for some time (since the 1960s or so; not sure??) and that is having a huge impact there. And Russia had a decrease in life expectancy awhile back; I have not looked at those stats in a while. Africa and India, to me, are the key areas to look at. China is beginning relax its One Child policy, and with so many Chinese, that can have a HUGE impact.
So, there are many factors to consider. Yes, the earth PERHAPS is getting near its limit to sustain human population. The next huge limiting factor may soon be CLEAN water to drink and irrigate crops. The shrinking glaciers in the Himalayas may drastically cut fresh clean water to India and Pakistan. The Sahara Desert is spreading south and will limit crops and livestock in Central Africa. Those are most of the trends that I know about, based on what I read from several and varied sources. A this point, I will not raise the specter of the possible impacts of Global Warming on many of these interconnected issues, beyond this cursory statement.
I did research this portion, now that I essentially finished this essay:
In 1798 Thomas Robert Malthus famously predicted that short-term gains in living standards would inevitably be undermined as human population growth outstripped food production, and thereby drive living standards back toward subsistence. We were, he argued, condemned by the tendency of population to grow geometrically while food production would increase only arithmetically.
https://www.scientificamerican.com/article/are-malthus-predicted-1798-food-shortages/#:~:text=In%201798%20Thomas%20Robert%20Malthus,living%20standards%20back%20toward%20subsistence.