A combination of factors.
1) Poultry ownership was often anciliary to other farming activities. So yes, the poultry got kitchen scraps and often corn or something resembling what we today call "scratch". But they also got to free range much larger areas than most of us enjoy today, and they got what the cow, pig, dogs, goats, etc missed. They also got the crops in the fields that fell off the vine, got missed by the combine, lost in the winnowing, too bruised, bug eaten, to be used in the kitchen, etc - lots of "other" sources of food.
2) Birds "back in the day" grew slower, were smaller, laid fewer eggs, and had lower hatch rates - all things that result in
reduced metabolic needs compared to their modern equivalent.
Remember that "a chicken in every pot" was a political slogan until the second half of last century - and that was on Sundays, not every day. Its only the last few generations where significant animal protein essentially every dinner, and about 50% (or more) of the remaining meals has become the US norm.
3) Ever hear the phrase "spring chicken"? Its because the flock was culled heavily going into winter, so there were simply fewer poultry mouths to feed. Then the flock size would be grown up by hatching fresh birds in late winter/early spring as food began to become more available. Undesired birds (males) would be sold in spring when they were still young and tender.
That French classic, coq au vin, is what you did with your second year rooster after he produced the spring and summer birds. Add alcohol and simmer into submission what would otherwise be a tough, nearly inedible, bird. Acid in the wine helped to denature proteins (creating the illusion of tenderness, long cook times allowed the collagens to gelatinize, and the alcohol helped bring out some flavors, buffer others - as well as helping with sanitation).
4) People who were raising poultry seriously fed their birds. They fed them nutritionally well designed rations.
@saysfaa has located some older books on feeding chickens - and while they didn't always know why a recipe worked (in fact, some admit that there is an "x" factor they couldn't measure, but are certain exists, which was critical to chicken's productivity) - thru trial and error they settled on a number of recipes that are roughly equivalent to a "modern" commercial ration. The "x" factor, btw, was Methionine. Measuring the sulphur containing amino acids individiually came about late last century, and is still relatively expensive.
Some of those recipes
are collected here. You will note that many of them cointained animal proteins - either from "meat scraps" or from milk byproducts like whey.
Commercial feed, btw, is about 110 years old now. 1910-1920 range.
There are other factors, and of course exceptions to such broad strokes, but the above accounts for much of it. Hope that helps.