They just burn themselves out when everyone it comes into contact with has acquired immunity (either through catching it, or vaccination). If there aren't any susceptible hosts, there can be no disease.
Plus, flu is constantly mutating, it gets less pathogenic and less virulent as well as it adapts to its hosts.