How did the Spanish flu go away?

Hi tonight Scott Adams put out a question in his podcast. How did the Spanish flu go away, herd immunity, vaccines …

I found it a good question and I don’t know much about viruses, Any research is welcome.