Checkpoint inhibitor-based immunotherapies that target cytotoxic T lymphocyte antigen 4 (CTLA4) or the programmed cell death 1 (PD1) pathway have achieved impressive success in the treatment of different cancer types. Yet, only a subset of patients derive clinical benefit. It is thus critical to understand the determinants driving response, resistance and adverse effects. In this Review, we discuss recent work demonstrating that immune checkpoint inhibitor efficacy is affected by a combination of factors involving tumour genomics, host germline genetics, PD1 ligand 1 (PDL1) levels and other features of the tumour microenvironment, as well as the gut microbiome. We focus on recently identified molecular and cellular determinants of response. A better understanding of how these variables cooperate to affect tumour-host interactions is needed to optimize the implementation of precision immunotherapy.