Bad news: Children still reject healthful food. Good news: It now becomes compost.

Depending on where the school is, the uneaten and half-eaten leftovers are sent to a compost heap at a former Staten Island landfill or to upstate New York or Delaware, where the slop is churned into nutrient-enriched dirt that farmers or landscape architects can buy. Eventually, the city will send some scraps to a wastewater treatment plant in Brooklyn, where “digesters” turn garbage into usable gas.

“There’s a lot of carbon in that banana that’s going to end up growing something else in your garden at home,” John T. Shea, the chief of the Education Department’s school facilities, said. “It’s the circle of life, baby.”

The hope is that by building up composting in school, the city will help the environment, instill a sense of conservation in schoolchildren and, critically, save some money. The city paid $93 per ton in 2013 to dump in landfills, up from $68 in 2004. Composting saves the city $10 to $50 per ton, because the cost is offset by the sale of the end product, according to the Sanitation Department.

After school, the bagged food scraps go on the curb. They are picked up each day by Sanitation Department trucks, then driven to the compost sites, where they are picked clean of contaminants, like plastic bits, and laid on a bed of dry wood chips. More wood chips are laid on. The muck is turned, so oxygen gets in to aid decomposition. Six to nine months later: market-ready dirt.