Melasma is primarily caused by an overproduction of melanin in the skin, often triggered by sun exposure, hormonal changes (such as those during pregnancy or from birth control pills), or certain medications. Women with darker skin tones are more prone to developing melasma, though it can affect anyone.