>>Your immune system is whats causing the symptoms. The immune system recognizes and treats the vaccine antigen as a pathogen. This means that the protein will trigger a complex system/cascade of reactions where a shit load of inflammatory and other signaling molecules are dumped locally and into the blood stream. This is necessary to mount an effective immune response, and to recruit and trigger an adaptive immune response. Locally, this causes inflammation/swelling, and systemically can cause other symptoms (fever, chills, fatigue).
More details: https://www.nature.com/articles/s41541-019-0132-6
>>This answered how vaccines in general can have side effects. Some may wonder why these particular vaccines seem to have stronger effects than say, a typical flu shot in many people.
Part of it may be the two dose issue, which is designed to provoke a stronger response in order to be more effective. It could also be partially due to something specific about mRNA vaccines compared to dead virus ones. These vaccines also have a lot of material (100 ug for Moderna) which was chosen because it had a good immune response.
>>My guess is that, because no mRNA vaccine has been made prior to the Pfizer-BioNTech and Moderna ones and because of the severity of the pandemic, the companies decided to err on the side of including more material in the vaccines (which risks stronger side effects) than using too little material (which would risk the vaccine being less effective). I don't know if we know whether mRNA vaccine in general have more side effects than something like the flu vaccine because flu vaccine manufactures have had decades of experience to help optimize their product versus us seeing only the very first versions of the mRNA vaccine technology.