How does the adaptive immune system work?