NSAIDs work by blocking the production of prostaglandins, which are chemicals in the body that promote inflammation, pain, and fever. By inhibiting the COX enzymes, NSAIDs reduce the levels of prostaglandins, thereby alleviating symptoms.
Corticosteroids, on the other hand, mimic the effects of hormones produced by the adrenal glands. They reduce inflammation by suppressing the immune system and decreasing the production of inflammatory chemicals.