In some ways evolution is inevitable but it is also a stroke of luck. The mutation behind the phenotype needs to actually happen. Then the mutant individual needs to actually have outsized reproductive success such that their progeny outcompetes with others and these mutant alleles spread in the population.