Post-inflammatory hyperpigmentation occurs after a skin injury or inflammation, such as acne, eczema, or skin lesions. The affected skin produces more melanin than normal, resulting in dark spots that may fade over time.