Topical steroids are absorbed into the cells of the skin. The mechanism of the anti-inflammatory activity of the topical steroids, in general, is unclear. (source: paragraph 12.1 “Mechanism of Action” )
It is believed that topical steroids stop skin cells from producing various inflammation-causing chemicals that are normally released when the skin reacts to allergens or irritation.
These inflammation-causing chemicals, including prostaglandins and leukotrienes, cause blood vessels to widen (vasodilate) and signal other inflammatory substances to arrive. This results in the affected area of skin becoming red, swollen and itchy.
By preventing these inflammatory chemicals from being released in the skin, topical steroids reduce inflammation and relieve related symptoms such as itchiness. Learn more about how corticosteroids work here.