Recognising invaders
Your T- and B-cells recognise invaders by the shape of molecules - antigens - on their surfaces. Your immune system can produce a T- and B-cell to fit every possible shape. However, any T- or B-cell that recognised molecules found on your cells were destroyed while you were growing in the womb, to prevent them from attacking your own body. But you were left with millions of others, one for every foreign antigen you might ever encounter.