They naturally forage around streams and ponds
The highest quality food items for peafowl are animal in nature and these are seasonally hard to come by. The most consistent source of animal and plant protein alike year round is in the shallows of rivers and streams.
Consequently peafowl are semi-aquatic, Indian peafowl much less so than Green peafowls but significantly more so than most pheasants. The long legged species are generally the waders. Lots of food readily found in the shallows for waders. It's an ancient way of life naturally- one that's been passed down from their most ancient ancestors no-doubt.
I rear guppies in giant pickle jars and in aquariums. Guppies are simply supplements only fed every few days and not in any huge number. The fats and oils, high entirely digestible protein and bony indigestible fibre of fish makes them an optimal supplement for peafowl- much more so than mealworms.