Why does the head swell after getting hit by something hard? What is the liquid that forms after impact?
When physical damage to the cells occur a biological process called inflammation occurs. When inflammation occurs, white blood cells are rushed to the area in order to fight off any bacteria or harmful waste leakage from damaging the cells further. In order to get the white blood cells to the site of damage faster, the body induces a process called vasodialation where the arteries are expanded and blood is rushed to the site. This causes the site of injury to swell and redden, two signs of inflammation. The white puss that forms comes from the white blood cells. The white blood cells release chemicals that kill of bacteria and waste in the area and forms a white pus that will eventually harden or break through the skin to be exerted. If the site of impact begins swelling within a matter of hours, it is likely acute inflammation is occurring and the body is rushing blood to the site. However, if swelling occurs on a more rapid time scale it is more likely that this fluid is from the damage of the impact itself and the cells and capillaries are leaking blood and extracellular fluids (What is Swelling?).
In short, when you bump your head your body is trying to fight off further injury and infection by inducing the inflammatory response. It is also leaking fluids due to the impact and may result in rapid swelling at site of impact. The symptoms you discuss are due to inflammation and are a normal process of your body's defense mechanism. Hope this helps!