Immune-mediated inflammatory diseases (IMIDs), such as spondyloarthritis (SpA), psoriasis, Crohn's disease (CD), and rheumatoid arthritis (RA) remain challenging illnesses. They often strike at a young age and cause lifelong morbidity, representing a considerable burden for the affected individuals and society. Pioneering studies have revealed the presence of a TNF-dependent proinflammatory cytokine cascade in several IMIDs, and the introduction of anti-TNF therapy 20 years ago has proven effective to reduce inflammation and clinical symptoms in RA, SpA, and other IMID, providing unprecedented clinical benefits and a valid alternative in case of failure or intolerable adverse effects of conventional disease-modifying antirheumatic drugs (DMARDs, for RA) or non-steroidal anti-inflammatory drugs (NSAIDs, for SpA). However, our understanding of how TNF inhibitors (TNFi) affect the immune system in patients is limited. This question is relevant because anti-TNF therapy has been associated with infectious complications. Furthermore, clinical efficacy of TNFi is limited by a high rate of non-responsiveness (30–40%) in RA, SpA, and other IMID, exposing a substantial fraction of patients to side-effects without clinical benefit. Despite the extensive use of TNFi, it is still not possible to determine which patients will respond to TNFi before treatment initiation. The recent introduction of antibodies blocking IL-17 has expanded the therapeutic options for SpA, as well as psoriasis and psoriatic arthritis. It is therefore essential to develop tools to guide treatment decisions for patients affected by SpA and other IMID, both to optimize clinical care and contain health care costs. After a brief overview of the biology of TNF, its receptors and currently used TNFi in the clinics, we summarize the progress that has been made to increase our understanding of the action of TNFi on the immune system in patients. We then summarize efforts dedicated to identify biomarkers that can predict treatment responses to TNFi and we conclude with a section dedicated to the recently introduced inhibitors of IL-17A and IL-23 in SpA and related diseases. The focus of this review is on SpA, however, we also refer to RA on topics for which only limited information is available on SpA in the literature.