Answer
When an infection occurs on the skin, the inflammatory response starts by releasing histamine, which in turn triggers vasodilation, or the enlargement of blood vessels. This increases blood supply to the area of the infection and results in the increase of white blood cells. White blood cells, or phagocytes contain macrophages that gobble up the pathogens that attack the infected area. This activity of the phagocytes triggers more histamine to be produced which repeats the cycle. The result of all of this is what we know as pus.
Work Step by Step
pg. 951 in Inflammatory Response contains a detailed explanation of how pus forms.