Post-inflammatory hyperpigmentation occurs when there is an overproduction of melanin in the skin after inflammation or trauma to the skin. Melanin production is stimulated by cytokines released during the inflammatory response, which signal melanocytes to produce more melanin and transfer it to keratinocytes. This results in darkening of the skin that can last for months after the initial skin injury or inflammation has resolved.