Antigenic variability occurs due to several mechanisms, including genetic mutation, recombination, and reassortment. For instance, viruses like the influenza virus undergo frequent mutations in their hemagglutinin and neuraminidase proteins, leading to new strains that can escape immune detection. Similarly, bacteria such as Neisseria gonorrhoeae can change their outer membrane proteins to avoid being targeted by antibodies.