Interferon gamma functions by binding to specific receptors on the surface of cells, initiating a cascade of intracellular events. This leads to the activation of various genes that enhance the antimicrobial and antiviral capabilities of the immune cells. It also promotes the expression of major histocompatibility complex (MHC) molecules, which are vital for antigen presentation.