Pain at the injection site is primarily due to the body's immune response to the vaccine. When a vaccine is administered, it introduces an antigen that stimulates the immune system to produce a defense mechanism. This process often involves inflammation, which can cause soreness, redness, and swelling. Additionally, the mechanical action of the needle itself can also contribute to localized pain.