It's thought to be an interaction of genetic factors and sun damage in most cases. Moles usually emerge in childhood and adolescence, and change in size and color as you grow. New moles commonly appear at times when your hormone levels change, such as during pregnancy.
https://www.fingerlakes1.com/2022/02/03/skincell-advanced-reviews-effective-mole-skin-tag-removal/