Genetic immunity operates through various mechanisms, including the presence of specific genes that either enhance the immune response or inhibit the ability of pathogens to infect host cells. For example, certain genetic mutations can alter cell surface receptors, making it difficult for viruses to enter cells.