The ability of lymphoid cells to mount a humoral or cellular immune response when challenged by antigen.