Exactly, it was random. Some birds grew smaller beaks and some got retarted and some got pretty feathers and some lost their feathers. Mutations are totally random and only VERY VERY few are positive enough to cause a species to flourish. Under those circumstances the ones who survive pass on the new beneficial genetics until you cant survive without them. At some point in the future you can become so genetically differentiated you become a new species and finally you cant crossbreed with similar species.
Humans have 2 chromosomes that were fused from a common ancestor with gorillas, chips and tangs. Downs syndrom have an extra chromosome. If people with down's syndrome had 50% higher IQ instead of being mentally handicaped they would become the new species to dominate the earth. Instead they are another bad mutation, like most mutations are.