The immune system uses specialized cells known as antigen-presenting cells (APCs) to detect pathogens. These cells capture and process antigens, presenting them on their surface to T cells. Once recognized, T cells initiate a targeted immune response.