Spotty enforcement laws are one of the problems.
In recent years, Fred Zenk built two barns housing about 2,400 hogs between them — long, white, concrete-and-metal structures that are ubiquitous in the Midwestern countryside.
The Iowa farmer didn't follow state requirements to get construction approval and file a manure disposal plan. But Zenk's operation initially flew under the radar of regulators, as have many others across the United States because of loopholes and spotty enforcement of laws intended to keep the nation's air and water clean.
Beef, chicken and pork have become more affordable staples in the American diet thanks to industry consolidation and the rise of farms with tens of thousands of animals. Yet federal and state environmental agencies often lack basic information such as where they're located, how many animals they're raising and how they deal with manure.
The animals and their waste have fouled waters. The enclosures spew air pollutants that promote climate change and are implicated in illnesses such as asthma. The stench of manure — stored in pits beneath barns or open-air lagoons and eventually spread on croplands as fertilizer — can make life miserable for people nearby.
For most of the nation's history, meat and dairy products came from independent farms that raised animals in barnyards, pastures and rangeland. But the system now is controlled by giant companies that contract with farmers to produce livestock with the efficiency of auto assembly lines inside warehouse-like barns and sprawling feedlots.
The spread of corporate animal farms is turning neighbor against neighbor in town halls and courtrooms. Iowa, the top U.S. producer of swine and egg-laying chickens, has been a major battleground.
"It's a fight for survival," said Chris Petersen, who still raises pigs in outdoor pens.
Michele Merkel, a former EPA attorney who quit over the agency's reluctance to punish polluting mega-farms and is co-director of the advocacy group Food & Water Justice, said the industry "has avoided any effective regulation and accountability for a long time."
Industry groups say there are plenty of regulations and livestock agriculture is simply adapting to improved technology, equipment and methods.
"We're responding to what the market is giving us," said Brady Reicks, whose company runs numerous large hog structures in northeastern Iowa. "We're doing it responsibly; we're passionate about doing it. It increases growth in rural Iowa and it helps feed the world."
The U.S. Environmental Protection Agency began to count the nation's factory farms during the Obama administration but retreated when industry groups sued. Instead, the agency uses state data to produce annual statistics about only the biggest operations.
As of 2018, the nationwide EPA tally was about 20,300 — a roughly five-fold increase over nearly four decades.
Yet it's a tiny fraction of all confined animal operations. The U.S. Department of Agriculture estimates there are more than 450,000, most too small for inclusion in the EPA count.
Iowa has 80 million farm animals and 3 million people. Yet in 2017, regulators didn't know how many livestock farms were in the state. Under federal pressure, the Department of Natural Resources pored over aerial photos, discovering 4,200 previously unknown facilities.
Zenk's Plymouth County farm was among them.
"We knew nothing about his operation," said Sheila Kenny, an environmental specialist with the state agency.
Zenk acknowledged breaking the rules but said no harm was done. He paid a $4,500 fine.
"You think you can get by with something once in a while and you can't," he said, strolling among his barns, tractor and feed bins.
To state regulators, such discoveries mean the system works. Critics say the Iowa experience shows how easily livestock operations can escape detection.
Putting thousands of animals in one enclosure produces huge amounts of manure. Unlike human sewage, which is treated and released to waterways, animal waste is stored, then spread on croplands as fertilizer.
Farmers insist they are careful.
"We take soil tests, we decide how much manure it needs and that's how much we apply," Reicks said.
Environmental groups say fields often can't handle the volumes of manure produced, leading to runoff. Such pollution is exempt from regulation under the 1972 Clean Water Act, even though agriculture is the biggest contaminator of rivers and streams, according to the EPA.
In Emmett County, Iowa, small farmer Gordon Garrison sued a nearby operation with 4,400 hogs, contending manure from its croplands fouls a creek that runs through his property and feeds the Des Moines River.
"They're using me for a waste disposal site," Garrison said.
Livestock farms generate about 70% of the nation's ammonia emissions, plus gases that cause global warming, particularly methane.
Yet they aren't required to get permits under the Clean Air Act. The government hasn't decided how to measure emissions from barns, feedlots, storage lagoons and croplands.
And under President Donald Trump, EPA has exempted livestock operations from requirements under other laws that industries report significant releases of air pollutants including ammonia and hydrogen sulfide.
Critics say yesteryear's barnyard whiffs were nothing like the overpowering stench from today's supersized operations.
"You don't want to be anywhere near them," said Brad Trom, a crop producer in Minnesota's Dodge County, who lives within three miles of 11 structures housing 30,000 swine. He says he's been staggered by powerful odors barreling across his fields.
Farmers say they're trying to reduce the smells but contend they're a normal part of country life.
"I've never lived on a farm that didn't have nature's fragrances on it," said Gary Sovereign, a swine producer in Iowa's Howard County.
Research has linked proximity to factory farms to various health risks. But scientists acknowledge it's nearly impossible to pin someone's illness on a certain polluter.
Jeff and Gail Schwartzkopf say after a hog mega-barn was built a quarter-mile from their home in northern Iowa, they developed burning and itching eyes, throat soreness and body rashes. They fear the manure odors are making them sick and ruining their home.
"Nobody's going to want to buy it. We're stuck," Jeff Shwartzkopf said