Vaccines function by stimulating the immune system to recognize and combat pathogens. When a vaccine is administered, it introduces an antigen, which is a substance that the immune system identifies as foreign. This triggers the immune response, which includes the activation of B cells to produce antibodies and T cells to destroy infected cells. Histologically, this can be observed as changes in the lymphoid tissues such as the spleen, lymph nodes, and mucosal-associated lymphoid tissues.