Nivolumab works by blocking the PD-1 receptor on T cells, preventing it from binding to its ligands PD-L1 and PD-L2 present on tumor cells. This blockade results in the activation of T cells and allows the immune system to recognize and destroy cancer cells. Histologically, this can lead to an increased infiltration of T cells into the tumor microenvironment.