Immune System. The Immune System The function of the immune system is to fight infection through the production of cells that inactivate foreign substances.