This is a wonderful explanation of inflammation, although a bit technical.
Key passage:
Inflammation, the immune response of body tissues to injury or infection, is an important component of innate immunity. The inflammatory process involves a complex biological cascade of molecular and cellular signals that alter physiological responses, ultimately resulting in the familiar clinical symptoms of pain, swelling, heat, and redness (1, 2). At the site of the injury, cells release molecular signals that cause a number of changes in the affected area: vasodilation, increased blood flow, increased vascular permeability, exudation of fluids containing proteins like antibodies, and invasion by several different types of leukocytes, including granulocytes, monocytes, and lymphocytes (3).
Inflammation does help fight disease, but it also can cause harm to the body's tissues in different ways. This is why healthcare providers often treat inflammation with things that bring down inflammation (ibuprofen and NSAIDs), excessive swelling (ice on sprained ankle), etc. That helps prevent further damage and reduce formation of scar tissue.
A very simplified analogy:
Inflammation is like a war zone on home turf, with your body's cells against bacteria/virus invaders (OR injured tissues OR sometimes for no reason). Our body cells sometimes go all out spraying napalm and dropping bombs. You may win the war but often with collateral damage. The war zone can keep burning for a very long time - the fires often keep burning for a while the war is over, and leave areas of scorched land behind. NSAIDs are like firefighters to suppress the burning flames.