Normally, frogs develop from tadpoles with just two hind legs. But there are unique circumstances in which they can develop anywhere from 0-10 legs.
It can occur from bird defects, but it usually happens when the tadpole becomes infected with a specific kind of parasite. After the parasite has made its home inside of the tadpole host, it invades the leg buds of the tadpole and develops into a cyst, which gets in the way of the buds eventually growing into legs.
As a result, the tadpole's body gets confused and begins growing legs sporadically. In some instances, legs don't grow at all, but in many others, more than 2 appear.
The legs stay with the tadpole throughout its life, including when it develops into a full-sized frog. This makes the frog less adept at getting around, making it easier for the parasite to spread to new hosts when the frog eventually gets eaten by birds.