When the immune system detects an infection, it triggers an inflammatory response. This involves the release of chemicals like cytokines and histamines, which increase blood flow to the affected area, bringing immune cells to fight the infection and promoting healing.