How does the Immune System Function?

It functions by finding the unwanted bacteria in your body and it remebers it and destroys it to make it go away. The reason it remebers it is so that it can develope immunity to it.