It's didn't disappear. It's still around today, over 100 years later. The 1918 influenza virus is the parent virus for all the human seasonal influenza viruses that are around today, as well as for most of the swine influenza viruses out there.
In fact, the presently circulating H1N1 viruses in humans are close enough to the 1918 virus that they probably immunize against each other (Seasonal trivalent inactivated influenza vaccine protects against 1918 Spanish influenza virus infection in ferrets.).
What did happen is that the 1918 virus mutated, becoming less virulent in the process, within a year or so of entering the human population. Why? Presumably because, after infecting virtually the entire human population in its first year, there was so much population immunity that it needed to mutate a little in order to continue to infect. That is, after all, what flu viruses do.
But it continued to circulate for decades, as a very similar H1N1 virus. Also, it almost immediately infected pigs and became endemic in the swine population, only to resurface after 90 years to cause the 2009 influenza pandemic.
In 2009, persons who had lived through the first decades of the 1918 pandemic H1N1 era, especially those born before about 1950, were substantially protected from the 2009 pandemic virus by having acquired immunity to the antigenically similar H1 or N1 of the 1918 virus, or both, or to the descendant seasonal H1N1 viruses that circulated over subsequent decades. This is because the 2009 H1 gene was a 1918 viral progeny that had survived for more than 90 years, with minimal antigenic drift, in a domestic pig “time capsule.”
—The Mother of All Pandemics Is 100 Years Old (and Going Strong)! (Am J Public Health. 2018 November; 108(11): 1449–1454)
In 1957 and 1968, the H1N1 virus reassorted with avian viruses to generate first H2N2 and then H3N2 viruses (the great-grandchildren of the H3N2 pandemic still circulate today). But most of the internal genes in those reassortants remained the 1918 versions.
So the 1918 flu never went away. It’s still killing hundreds of thousands of people every year. It’s just that everyone has got used to it, and thinks it’s fine and normal to have hundreds of millions of influenza cases every year.