The short answer is that there are many types of birthmarks with different causes. Some are related to unusual areas of skin pigment, some are due to unusual blood vessel structures, some are from differences in the layer of fat below the skin and many more.
This site has a lot of information, but in pretty technical terms. https://dermnetnz.org/topics/congenital-naevi/
Latest Answers