what has caused birds to divert from mammals, reptiles and amphbian ?
why do they have a different pentadactyl limb structure? what caused this to happen?

Birds are the descendants of one particular reptile group, the dinosaurs. In fact, the vast majority of scientists who study the issue prefer to think of birds as modified dinosaurs (and therefore modified reptiles) rather than as a separate group that has "diverged".

A pentadactyl limb is just one that has five fingers or toes. This basic pattern was established very early in the history of tetrapods (the group including all vertebrates other than fish) and has been retained in many animals, including humans. However, there are also many cases in which fingers and toes have been lost, in groups whose lifestyle permits them to survive as well or even better with a smaller number. Horses have only one finger or toe, modified to make a hoof, on each limb. Snakes have no fingers or toes at all!

In theropods, the generally predatory dinosaurs from which birds evolved, fingers and toes started to disappear at an early stage. The close ancestors of birds would have been small, predatory animals whose feet had four toes (one of which was very small) and whose hands had three fingers. As birds evolved and the forelimb became adapted for flight, rather than other functions like climbing and grasping prey, the hand became more reduced than ever. There are still actually three fingers in most birds, but they are very small and their main job is to provide attachment for feathers.

So why did theropods lose two of their original five fingers in the first place? There's probably no really simple and satisfying answer, but part of the explanation must be that even the earliest theropods (and their close non-theropod relatives) were bipedal. Because theropods were no longer using their hands for walking, some evolutionary experimentation was possible, and the result was a three-fingered hand that apparently worked well for grasping and raking.