When the Spanish influenza hit in 1918, it struck in two waves. The first wave was typical for a flu virus, targetting mainly elderly people, but the second wave was far deadlier and killed far more young people. How likely is it for something similar to happen with the current coronavirus? Also, wikipedia states that people who contracted the virus during the first wave were immune to it in the second wave. I thought when a virus mutates it usually avoids detection, hence why we need to usually get an up to date flu vaccine annually. Why was this not the case for the spanish influenza?
This is a great biological question! It asks a lot about how empirical science is done in the field of modern biology! I'm glad we encourage such questions from curious people who want to learn more.
Mutations are mostly deleterious to begin with. This means that mutant copies of virus only very rarely survive and proliferate. A virus that is deadlier will already be less likely to reproduce, having killed more hosts.
The current estimated mutation rate of the SARS-CoV-2 virus is 24 bases per year. Of those mutations, those to be most concerned about are those which would mutate the proteins specific to this virus. Vaccine development will aim to train the immune system to target those proteins, particularly the S or spike protein.
Mutations to those proteins can make potential vaccines less effective. This is why influenza ("flu") vaccines, which are produced ahead of the flu season, may not always line up against the more prevalent strains which result.
A recent comment was published in Nature, authored by life scientists and epidemiologists, which goes into your question in more detail, as regards to the novel coronavirus:
In this case and that of SARS-CoV-2, mutations consume the narrative, even though individual mutations seldom become fixed during outbreaks nor modulate complex virological traits. Rather, mutation is a humdrum aspect of life for an RNA virus. Because these viruses employ an intrinsically error-prone RNA polymerase for replication, their genomes will accumulate mutations during every copying cycle. Moreover, these cycles can occur on the order of hours, ensuring that a diverse virus population will be generated within a single infected host. While this amazing capacity to mutate fuels the engine of evolutionary change, most mutations adversely impact some aspect of virus function and are removed by natural selection. (emphasis added)
Further, and more to the original point of your question:
These warnings will probably not halt the question as to whether mutations will arise in SARS-CoV-2, enabling it to spread more efficiently between humans or generate a higher case fatality rate. In response, we can look to the 2002–2003 SARS-CoV epidemic. Large deletions in the open reading frame 8 (ORF8) region and mutations in the spike (S) protein were discovered during the early stages of the outbreak and eventually dominated the epidemic, suggesting that these were adaptations to humans12,13. Based on this observation, some hypothesized that virus genetic changes in part drove the SARS epidemic, but this claim is unsubstantiated14. So, could SARS-CoV-2 adapt in the same way? Yes. Will adaptation precipitate more deaths? Unlikely. (emph. added)