Inflammation is a mechanism of the body that creates swelling, redness, pain or tenderness, and heat. Inflammation generally accompanies an infection, but the two are separate occurances.
Inflammation has many causes and many potential effects. It triggers the immune system to fight infections. The swelling may partially immobilize an injured joint to prevent further injury.