By the time the mid-19th century rolled around, many of the great thinkers of the day began fearing that the end was near. Thanks to the advent of modern science, the world's population had topped one billion people for the first time. However, the understanding of how the world worked had also grown to the point that those who did the math began to predict that it wouldn't be long until farms could no longer keep up with the growing demand for food. Basically the amount of certain needed nutrients in the soil was limited, chief amongst them being nitrogen.
Now throughout most of history, nitrogen got into the soil via the creatively named nitrogen cycle, whereas various bacteria fixed nitrogen from the atmosphere and rotting dead plants and animals in the ground, which then became available for plants to use. From the age of the earliest civilizations, this natural process was aided by farmers by the application of livestock shit directly onto fields. However, shit also contained a lot of salt, meaning it could damage the soil if too much was put on at a time, and by the 19th century the demand for food was growing beyond the yields which shit could provide.
In the early 1800's it was discovered that certain types of bird and bat shit, called guano by the classy, had amounts of concentrated nitrogen far above that of the livestock shit, with much less salt, meaning guano could be used to greatly boost crop yields. As a result, by mid-century these deposits, which were mostly on scattered islands near the equator, were quickly being claimed by any nation that had the power to do so. The super shit that was guano allowed food production to keep up with population growth through to the end of the century, making many individuals and several countries fabulously wealthy. Of course, as goes with anything like this, there were all sorts of human rights abuses and even two separate wars in South America over guano deposits.
When mining of the guano began, many of the islands had piles of shit on them more than 150 feet deep, with birds and bats continually working to replenish them even as they were mined. However, by the start of the 20 century, the scientists of the world again came to the conclusion that the end was near. Guano deposits were beginning to run low, and new sources of mineralized nitrogen found in Chile's Atacama Desert would not be enough to both make up the difference and the growing demand. It was at this time that a German scientist by the name of Fritz Haber entered the scene.
For the scientific world, the global food problem had a simple answer. They just needed to get their hands on more nitrogen somehow to boost yields. This problem was especially maddening given that 74% of the frickin atmosphere was nitrogen, but it was inaccessible due to it being a gas and a bunch of other issues involving chemistry. It was Fritz Haber who came up with the answer in 1909. Haber, being one smart schmuck, figured out a method to harvest nitrogen from the atmosphere by putting it at a high pressure and temperature in a steel tank, and then injecting hydrogen. The resulting chemical reaction created liquid ammonia, known as nitrogen trihydride by sciency folks, which made for a perfect fertilizer.
Haber's method, which became known as the Haber Process, was seen as nothing less than a god damn miracle. No longer were humans constrained by the natural nitrogen cycle. For the first time they could make as much nitrogen fertilizer as they could ever need. Over the proceeding decades, billions of tons of nitrogen fertilizer were produced, allowing significant increases in crop yields, which in turn allowied the human population to reach 7 billion and beyond without the ever present threat of mass starvation. While the increased use of nitrogen fertilizers has undoubtedly caused issues for the natural world, it is undeniable that our society today only exists because of them. So there you go, magically sucking fertilizer out of the air. One of the greatest inventions of all time.