The first 3 biologics finding great success as cancer immunotherapies are targeted at what are termed immune checkpoints. These are T-cell receptors which, when docked with a corresponding ligand of an Antigen-Presenting Cell (APC eg macrophage), deactivates the T-cell and thereby winding down the immune attack against microbial invaders or rogue cancer cells. It's like letting the guard down at checkpoints when the appropriate ID/passport is displayed, or when a password challenge proves correct. By blocking these cellular checkpoints, the T-cells stay alive and active longer to perpetuate the attack on cancers and infections (eg HIV).
Ipilimumab blocks CTLA4 to maintain T-cell activation, while Nivolumab and Pembrolizumab block PD-1 (programmed cell death) to keep T-cells alive longer.
CTLA4 is perhaps the most significant checkpoint in limiting T-cell activation as it competes against another similarly-shaped "lock" on the same T-cell (CD28) for the "key" on the APC (B7.1/2 aka CD80/86). When B7 docks with CD28, it gives the second signal necessary to activate the T-cell recognising the first signal (a fragment of "evidence" co-presented by the same APC). It's like unleashing a nuclear attack: the immune system wants to be doubly sure it is not making a mistake like attacking self.
Unlike CD28, which when docked with B7 will signal into the T-cell to ramp up the war machinery, CTLA4 is a "dummy" lock: nothing signals through. It therefore merely competes with CD28 for B7. Why this duplicated redundancy on the same T-cell, you may wonder? That's just a tiny glimpse of how brilliantly designed the immune system is.
Normally, cells die all the time. APCs gobble up friend and foe, not just for recycling, but to present the fragments to the intelligent T-cells to differentiate whether they belong to friend or foe, and then to mount an attack or to let pass regular housekeeping. When the APC presents the second signal (B7), CTLA4 binds B7 with far greater avidity than CD28 does, thus signalling "housekeeping" mode. However, when there is massive enemy attack and cells are dying in large numbers, the CTLA4 will be overwhelmed by lots of B7 co-presented with "evidence", and CD28 become increasingly triggered, and the T-cells go into "war" mode.
Sublimely brilliant, no?