Early humans ate a lot of plants – and they needed to eat them quickly enough that they could eat a sufficient amount in one day to get all of the nutrients they needed.
For this reason, we had an extra set of molars to make the larger mouth more productive.
This was particularly essential as the body lacked the ability to sufficiently digest cellulose. As evolution made its selections, our diets changed, our jaws grew appropriately smaller, and our third molars became unnecessary.
Some human populations have now all but completely stopped growing wisdom teeth, while others have almost 100% likelihood of developing them.