Virulence is defined as causing damage to the host. If the virus kills everyone in that small proximity, the virus will no longer be able to reproduce or spread, plain and simple.
Viruses are super crafty in obtaining their limited number of proteins from the host. However, some viruses bring enzymes with them to get the job done without much help from the host. These are typically larger RNA viruses. Influenza is in this group, but it still steals the 5' cap from the host. This happens without miss as it's able to interact with the host RNA polymerase undetected and then this cap makes it so the influenza RNA appears to be host RNA.
The 1918 influenza was so deadly as it had just jumped to a new host, humans. The same exact influenza responsible for the 1918 pandemic has relatives still in circulation. It's not in circulation as the less virulent versions were more successful. This explicitly demonstrates the preference to be less virulent.
If a virus doesn't need many proteins from the host, it's able to reproduce much more quickly than one dependant on more host resources. The more resources it needs, the increased ability of the immune system to prevent it's reproduction. So in many situations, a lower requirement for host resources can make it more successful. Regardless, it can be very dependent on host resources, like many DNA viruses, and still not be very virulent. A great example of this is Hepatitis D. Virology is a fascinating field and it's highly intricate as a virus is more like it's host than any other viruses. There's not a lot of commonality between different viruses and their reproduction cycles. So viruses in the same family are compared, and the 1918 becoming less virulent shows there's a preference for becoming less virulent over time.
A solid privacy conscious youtuber, The Hated One, just published a video on this exact topic. It's very detail oriented and should be easy for anyone to follow along. Here's the link: https://youtube.com/watch?v=A8ZXDiQLH9I