The Answer
Back when people hunted and gathered for food, we needed another set of molars to chew stiff, hard-to-digest materials (like cellulose).
For something that tends to do more harm than good, it’s a wonder people get wisdom teeth at all. Wisdom teeth were very important tens of thousands of years ago, when they were necessary for us to chew harder food.
But after humans invented agriculture, wisdom teeth became not only useless, but dangerous. With softer diets during childhood, our jaws are not able to grow as much, and there is often not enough room for four extra teeth to grow in. Most people get their wisdom teeth removed, because this can cause a lot of problems.
Wisdom teeth, like baby teeth and adult teeth, exist in the skull even before they grow into the mouth. Unlike the other stages, wisdom teeth do not make up a full set of teeth, and they should grow in as an addition to the teeth already there.
Genetics plays a major role in determining whether a person will get wisdom teeth. According to Wikipedia, almost no Aboriginal Tasmanians develop wisdom teeth, but almost all Indigenous Mexicans end up with them. Men are also more likely to have wisdom teeth than women. Genetics seem to affect the age at which you are more likely to develop the teeth as well. People with African heritage often develop them earlier than people with European or Asian heritage.