The Spanish Influenza was honestly an utterly fascinating pandemic, in part because it was one of the best-documented pandemics of the early 20th century. The 1918 Influenza, better known in America as the Spanish Influenza, changed the landscape of the western world. However, this response shall focus mainly on the effects it had on America to limit the scope of the answer. Answer why the 1918 Flu stopped spreading, it must be broken down into three parts: what it was, why it spread, and how it died out.
So, what was the 1918 Flu? In short, it is a highly contagious viral mutation of the illness best known as the flu. Infecting between 3-11% of Americans every year, it usually is not very deadly, primarily killing the elderly, the very young, or anyone else with a comprised immune system. The virus, which mutates and changes often, has various strains with varying levels of severity, in part because it often hops between species. The 1918 influenza was remarkable because of how deadly it was and how quickly it spread. The most popular theory right now is it was an avian virus that mutated to infect swine, and then onto humans (Nelson, Worobey 2018, p. 2498). Of course, this is not definitive due to the difficulty in studying such an infectious disease, especially considering the limited number of viable samples. However, assuming this is true, it can begin to explain why it had a higher mortality rate than most recorded influenza strains. There were other factors at play as well, which also merits consideration.
From 1914 to 1918, the first world war ravaged the western world, causing around 40 million casualties (Encyclopedia Britannica, 2020). While movies portray the World Wars as glorious and bloody, with young men dying bravely for king and country, the fact is disease killed more people than the fighting ever did (Diseases in World War I - World War I Centennial, n.d.). Soldiers lived in squalid conditions, that are frankly unimaginable to the modern American. Dead bodies left to rot and fester where they lay, near the trenches that so many soldiers spent months in, knee-deep in mud, little food, and very tight quarters; it was a petri dish of disease and death.
Of course, military hospitals and training camps were barely better. After all, not even a century beforehand, doctors had barely considered handwashing, and it took decades before it caught on in the greater medical community (Geneva: World Health Organization, 2009). It should be no surprise then that the first recorded case of the 1918 influenza case was in an American military base in Kansas (Centers for Disease Control and Prevention, 2018). The first wave of the disease was in the spring of 1918, where over the next six months, it spread in small bursts.
However, the virus changed around the fall of 1918 when the disease suddenly became markedly more infectious and deadly. As noted above, influenza viruses are volatile, mutating frequently, which is why there is a new vaccine every year. The virus likely would not have been half as deadly, had it not been for the war. People who would ordinarily never travel farther than a few towns away from where they were born were suddenly going to countries they would otherwise never have seen, the virus their invisible passenger. October alone saw almost 200,000 Americans dead, terrifyingly high number. Nurse and doctors were falling like flies; fighting was slowing down in Europe, partly because the soldiers there were too sick or dead to fight (Holmes), and it was getting harder and harder to get new soldiers out on the battlefield- they kept dying in transit. November saw the end of the bloodiest war the world had seen at that point because there were not enough men healthy enough left to fight.
So the Spanish Influenza reigned for the next year or so, leaving piles of bodies in its wake. With our background in hand, now the question at hand can be answered: why exactly did the 1918 pandemic fizzle out? Well, there are three main reasons. First, the end of the first world war had a significant impact on restricting the spread of the disease and freeing up the doctors and nurses who had been serving on the front lines. While it would be easy to assume that the Americans returning home after the armistice would infect those around them, soldiers often remained in military care until recovered from the flu, partly because those afflicted were usually too sick to transport.
Secondly, public health education programs were profoundly effective, in combination with new laws. Many of the hygienic habits we have today stem from work during the pandemic to promote personal sanitation (Marisam, 2007, p. 279.2). The National Institue of Health, or NIH (which was founded to fight the 1918 Flu), promoted, along with local efforts, things like handwashing, wearing masks, social distancing, and not spitting in public. There is a heap of pictures from the period that show the posters, signs, and flyers that tell citizens to practice what is now basic hygiene ([[Collection of photos from 1918]], 1918).
Finally, the biggest reason the pandemic died out was that the virus mutated. While it is easy to assume the deadlier the virus, the better it is doing for itself, which simply isn't true. However, if a virus kills all of its hosts, then it no longer has any viable hosts. Instead, the most successive virus is the one that can chill in a host long enough to spread. There is also the fact that virus mutation is luck of the draw. Sometimes the mutation is efficient for survival, and other times not so much, just like humans are sometimes born with harmful genetic mutations.
It also be noted while the exact strain which killed so many during the fall 1918, the flu, and even H1N1 are rarely fully eradicated. u/TheNthMan did a really good job of explaining the actual science behind it, so go read his answer. My response, however, really focuses on the historical part of it.
So, in TL;DR? It burned itself out too fast, and when it mutated, it could not survive against the public health measures people had taken. If there are any questions or anything that needs a citation, please let me know, and I shall do what I can. I hope y'all are doing all right and staying safe <3
-The world's most annoying yet boring pre-med student with an obsession with epidemiology.
EDIT: Just wanted to make a note explaining why I answered the way I did. I admit most of my response doesn't answer the question directly, I was trying to write this in such a way that if all you knew nothing at all about the topic, you could still follow along. If anyone would like a more detailed answer, particularly on the science of it, or at least, what the popular theories currently are, I would be happy to. It's really interesting, but I figured as a history sub it would be better to focus on the historical facets of the question in an accessible way. Thank you ♡♡♡
EDIT 2: So, as some very helpful (and nice!) people have pointed out, there are a few issues. So I'm adding a source to paragraph 7, and changing a sentence for clarity. I'm also fixing some weird word choices.
Nelson, M. I., & Worobey, M. (2018). Origins of the 1918 Pandemic: Revisiting the Swine “Mixing Vessel” Hypothesis. American Journal of Epidemiology, 187(12), 2498. https://doi.org/10.1093/aje/kwy150
World War I - Killed, wounded, and missing. (2020, July 21). Encyclopedia Britannica. https://www.britannica.com/event/World-War-I/Killed-wounded-and-missing
Diseases in World War I - World War I Centennial. (n.d.). The United States World War I Centennial Commission. Retrieved August 2, 2020, from https://www.worldwar1centennial.org/index.php/diseases-in-world-war-i.html
Geneva: World Health Organization. (2009). Historical perspective on hand hygiene in health care - WHO Guidelines on Hand Hygiene in Health Care - NCBI Bookshelf. The National Center for Biotechnology Information. https://www.ncbi.nlm.nih.gov/books/NBK144018/
Centers for Disease Control and Prevention. (2018, March 21). History of 1918 Flu Pandemic | Pandemic Influenza (Flu) | CDC. https://www.cdc.gov/flu/pandemic-resources/1918-commemoration/1918-pandemic-history.htm
Marisam, J. (2007). Lessons in pandemic flu from 1918. BMJ, 335(7614), 279.2-279. https://doi.org/10.1136/bmj.335.7614.279-a
[Collection of photos from 1918]. (1918). Getty Imagines. https://www.gettyimages.com/photos/1918-flu-pandemic
Holmes, Frederick. The Influenza Pandemic and The War, University of Kansas School of Medicine, 9 Apr. 2019, www.kumc.edu/wwi/medicine/influenza.html.
Unfortunately, your question is based on an incorrect assumption. The Spanish Flu of 1918 did not stop spreading. It became one of the seasonal flu variants that circulated in the population[1].
The question is why did the subsequent seasons result in much fewer deaths. The dominant hypothesis is that there was a rapid mutation to a less deadly strain after the second wave. It is a recognized tendency for pathogenic viruses to become less lethal over time as the deadlier strains die out, though pathogenic viruses can always mutate into a deadlier strains. In 1952-1953 there was an influenza epidemic of the H1N1 variant that had a peculiar mortality curve, affecting the young more then the old, because the older people had some immunity due to having been exposed to the earlier 1918 variant[2].
The 1957 H2N2 pandemic, followed by the H3N2 pandemic largely crowded out the H1N1 1918 Spanish Flu from the seasonal circulation in the human population. H1N1 variants still did circulate, but they were not the dominant strain and they were not a significant contributor to the flu seasons after 1957. However, the 1970 swine flu outbreak at Fort Dix was an example that the Spanish Flu virus descendants were still endemic to swine and could jump back into human hosts. This was reinforced by the 2009 swine flu pandemic, which was a re-assortment of four different H1N1 virus, and where it was noted that people born before 1950 who had exposure to the 1918 Spanish Flu virus (or its descendants) had protection from the "new" flu pandemic[3]. It is also an example of a less-lethal endemic virus mutating into a more deadly strain. Since the 2009 swine flu pandemic, the seasonal trivalent inactivated flu vaccine that protects against the Swine Flu descendents also protects against the 1918 Spanish Influenza virus[4].
The normal mortality curve for flu outbreaks is usually causing higher deaths in the very young and very old. The Spanish Flu, similar to the 1952 epidemic and to some extent the 2009 Swine pandemic had an unusual mortality curve where it affected young adults more then elderly. One theory is that the Spanish Flu caused cytokine storms which caused the higher death rates of young adults. A 2007 study of journals of the period of time of the Spanish Flu Pandemic finds that the the flu infection was no more aggressive than other previous influenza strains. Among the different theories on why the Spanish Flu affected young adults more is the possibility that the Spanish Flu is itself a descendent of a previous H1N1 flu that had swept through the world earlier, but was removed from the yearly circulating strains by the 1889 flu pandemic[5].
In summary, the 1918 Spanish Flu never stopped spreading. The human population (and swine population) never achieved a herd immunity. The strain probably evolved to be less deadly and humans have learned to live with the seasonal flu (in all its different subtypes, not just the 1918 H1N1 subtype) in a way that it "only" kills 290,000 to 650,000 people per year [6] globally through treatment (better nursing and treatment to manage downstream effects like bacterial infection of the lungs, cytokine storms and also through development of medicines like antivirals) and prevention (better awareness and hygiene, and the massive effort each year to develop and distribute the appropriate yearly flu vaccine).