The whole feed business, commercial and home grown is a bit of a nightmare to make sense of. No doubt there is much that could be improved in commercial feed, particularly the feeds that get sold to backyard keepers. The feed the large progressive commercial concerns use is not the same from what I've read and been told.
in more recent times the human food fads that hit the media and their associated politics have been applied to the chicken. There are countless home brew chicken feed recipies often based on no more than we are told it's good for us so it must be good for them. It would take an awful lot of long term research to see how chickens fed these alternative diets fared over the long term.
Science has worked out the basics of what we need to be reasonably healthy.
For humans we have a good estimate of the quantities of protein, vitamins and minerals we need to sustain life. It wasn't that long ago that simple cures for rickets were researched or the discovery that vitamin C addressed scurvy. We are still learning after all these thousands of years how to feed ourselves properly.
The articles below posted by Perris suggest that given a choice of foodstuffs a chicken can balance it's diet. Interesting word is balance. What one needs to be careful of is not assuming that being able to "balance" a diet means the subject knows what's good for them to eat. There is a world of difference. We don't know; the high mortality rate related to diet is proof of that. I don't know of any other creature that knows.We learn't about what to eat and how to eat pretty much by what we were given as children and the tales of don't eat that, Aunty Dodds ate some and dropped dead.
Now we are better informed, we read labels, some will know what quantities of particular nutrients they should eat for their body weight. Others may go by the eat five types of vegetables a day rule. Dump a pile of mixed unlabled foodstuffs in their natural state in front of many people and they'll be asking what it is and what they should do with it, if anything, before eating it. Not much instinctive knowing going on there.

I suggest chickens are much the same.
Some creature like the Panda for example need a very particular diet to survive.
Chickens, like us, are completely omnivorous. They'll try just about anything they come accross.
One of my elder sisters newly introduced Silky pullets when let into the garden head for a bay leaf plant and ate enough to pack her crop solid and ended up at the vets having the leaves pulled out of her cut open crop by the vet. She probably knows she shouldn't eat any more of that unless she really liked the vet.

The chicks I've observed have all been broody raised and I watched mum teaching the chicks what was and what wasn't good to eat. Yup, mum told them to eat the chick crumb supplied because she knows the chicks have to eat and that was what was there at the nest site. Once away from the nest a lot of mums tried to stop the chicks eating the supplied feed and encourage them to eat what she foraged for them. The chicks learn whats good to eat. I've yet to see any sign of a chick knowing what's good to eat and what isn't at birth. It's all learn't and/or based on opportunity. Luckily, because chickens are omniverous the vast majority of what they try out won't kill them and they develop diet preferences.
Most of us eat commercial feed. Not many of us eat natural produce. We've been eating commercial feed for that long that in the event we had to return to foraging (we were never the great predator some seem to wish) most of us would die because we don't know what's good to eat.
Science has taken some of the risks of malnutrition off the worry list for the more affluent and better educated people on the planet. Many of us got fed UPFs as children from breast milk substitutes to tiny canned baby dinners. We lived to tell the tale and overall our survival rate has improved over the centuries; not through any instinctive knowledge but through science investigating diet and us learning about what science has discovered.
We now know that we and chickens require certain nutrients for survival.
Commercially produced feed supplies them much as it does for us.
Recently science has discovered that the provenance and production processes and certain additives in food are probably not good for us or the chicken. However, in general the nurtition calculations still hold up.
My view is still, if the chicken doesn't have access to a wide variety of forage then feed them a commercial feed.
https://www.sciencedirect.com/science/article/pii/S0032579119347285
https://www.sciencedirect.com/science/article/pii/S0032579119562289
one from 1932 and the other from 1979.