I don’t think evolution is necessarily random.
A group of scientists thought they had it all figured out and challenged God to a contest. First they said “We’ll start with this pile of dirt”. God said, “Oh No...get your own dirt.”
A out of large number of totaly random mutation ...myou may have some that just by happen stance offer serendipitous advantage to the animal with a mutation ....and because of that serendipitous advantage that animals more likely to survive and more likely to reproduce so that mutation is more likely to get propagated
..IE random mutations produce some animals that juse happened to have longer necks...amd if they eat leaves in trees.. because they have longer necks they can reach higher in the trees to get leaves that other can not ... so they have serendipitously found new unexploded niche for food...and the giraffe is created