Primary gynecomastia develops during puberty due to hormonal imbalance, while secondary gynecomastia can result from weight gain.