You mean prolific as a group, as in speciose, or prolific regarding the number of eggs they lay?
The key to their success as a group has often been suggested to be their masticatory apparatus, which was pretty sophisticated for a reptile. They had "dental batteries" consisting of many rows of teeth (hundreds of them) which were constantly being worn down and replaced, a little bit like shark teeth (except instead of falling out they'd be reabsorbed when worn out and new ones would erupt to occupy their place). This ensured that hadrosaurs were never left toothless (unlike say, elephants, which have only six sets of molars during their lives and often die of starvation once they have worn the last one).
The dental batteries functioned as a grinding surface, like a mammal's molars, allowing them to process hard, fibrous plant material that other dinosaurs could not eat (most plant-eating dinosaurs either had very simple masticatory capabilities, or none at all, using their beak or front teeth to crop vegetation and basically swallowing it whole).
This would have allowed hadrosaurs to feed on a wide array of foods and fill ecological niches with very little competition. Another advantage they had was their large size and the ability to stand on their hind legs to reach food located at 4 m above ground or more, again minimizing competition with other dinosaurs (the golden age of hadrosaurs was the late Cretaceous, when sauropods had become rare in the Northern Hemisphere. Perhaps it is no coincidence that hadrosaurs, although certainly present in South America, for example, never became as abundant and speciose as they did in the north; sauropods were very much still in business in the southern hemisphere all the way to the KT extinction).
As for why they lay so many eggs, I'd imagine for the same reasons ostriches, crocodiles and turtles do- to increase chances of survival of at least some of the clutch. Baby hadrosaurs also grew very rapidly to minimize their chances of being eaten by smaller predators.