Evolution has no goals.
Take the Lenski experiments, for example.
Richard Lenski and his researchers followed several lineages of E. coli for 20 years (in fact, they’re still following them). They would freeze samples every 500 generations so they could go back and re-run the tape of evolution should some fundamental change occur. And, eventually, such change did occur. Some E. coli were able to consume a natural by-product of their environment after nearly 30,000 generations. Lenski et al. unfroze the old generations to see just what enabled the bacteria to obtain their new found skill. As it turned out, they had to go back many thousands of generations; it wasn’t just one mutation, but at least three. The first two were effectively random. But they were necessary in order to get to the third mutation – the one that opened up a new food product for the colonies. But in the re-running of the tape, not all lineages re-evolved the new mutations. They weren’t predestined to evolve a particular trait; nothing was inevitable.
And so it is with all of life. We are our genes, and how our genes are propagated via natural selection is not a goal-oriented process.