How does an mRNA vaccine work?

The technology is likely to be used for a variety of other diseases, so understanding them now is key.