The primary mechanism behind gynecomastia involves an imbalance between estrogen and testosterone. Estrogens stimulate breast tissue growth, while androgens like testosterone inhibit it. When this balance tips in favor of estrogens, gynecomastia may develop. This imbalance can be caused by increased estrogen production, decreased androgen levels, or exposure to chemicals that mimic estrogen activity.