the purpose of the ____ system prevent foreign substances from entering the body and to attack foreign substances that are in the body