Supposedly evolution was very efficient and evolved many human proteins over a few thousand generations. Yet obvious detrimental traits like wisdom teeth remained. Why?
Reductions in the size of our lower jaw that result in wisdom teeth sometimes becoming impacted result from changes in our diet, and are not the direct result of the evolution of a smaller jaw. This means that natural selection has had at most 8000 years to act on the phenomenon, which occurs in people in their mid to late 20s (who, historically, probably would have already reproduced if they were going to), and so the selective advantage of lacking wisdom teeth has not had enough time or been strong enough to cause the no-wisdom-teeth phenotype to spread throughout the human population.
Wisdom teeth do have a function. If you are missing a molar before the age of 20, a wisdom tooth can easily move in to fill in the gap, by filling in the space or by pushing the molar ahead of it.
This trick has been used by dentist to "fix" the teeth of teenagers who have molars with large cavities but still have wisdom teeth that have not erupted. So rather than go to extremes to save a bad molar, it is just yanked out and the wisdom tooth slips in. Problem solve. ( of course it depend on the actual wisdom tooth as some wisdom teeth are improperly positioned or appears unlikely to erupt to enable this trick to be used) example
Modern dental hygiene is good (but not good enough). So people tend to have all their molars in their early 20s (but not in their mid 30s). The the wisdom comes in too early to be useful to modern people. But i am guessing it had more use in earlier times.
That said... the trait for (third molars) wisdom teeth does not appear to be under positive selection in the human population as not everyone has it. Numbers vary depending on population. 10 to 25 percent of Americans of European ancestry are missing at least one third molar. For African Americans it is 11% and Asian Americans, the figure is 40 percent. The Inuit, a group of people who live in the Arctic regions of Canada, Greenland and Alaska, have the fewest wisdom teeth; about 45 percent of them lack one or more third molar.