Last month, the cavernous, blue-roofed pulp and paper mill in one-stoplight Madison, Maine, shut down, ending more than a century of paper production on the banks of the Kennebec River. More than 200 people are losing their jobs and the rural river town (pop. 2,630) is losing its biggest taxpayer. It’s one of several paper mills in Maine that have gone under in recent years, undone by a shrinking market, high energy costs, and unfair competition from Canada.

On the United States campaign trail, the displacement of workers in places like Madison and elsewhere has created a visceral backlash against free trade. Presidential aspirants like Donald Trump have railed against China and Mexico. Canada, by contrast, barely rates a mention, even though it’s the largest US trading partner.

One big reason is that, by most measures, Canada-US trade is mutually beneficial, enriching both nations with an annual exchange of $575 billion worth of services and goods, from autos and machinery to plastics, snacks, and shampoo. It’s also an example of how deep and successful trade relationships work, even as it throws up thorny challenges like paper-mill subsidies.

“The mark of a good agreement is not that you don’t have disputes. The mark of a good agreement is that you have a mechanism for resolving the disputes,” says Ron Kirk, former US trade representative during President Obama’s first term.

Madison is a portrait, both of the costs of free trade for some communities and of how those costs fit into a framework that is beneficial for others.

What the US and Canada are fighting over

The paper dispute echoes a much larger cross-border battle over Canadian lumber – the longest-running trade dispute between the two nations in modern times. The issue is how much duty, if any, the US should impose on Canadian timber that is extracted from government-owned land. Just as Madison has relied on its paper mill for jobs, Canada relies on lumber exports, which would be put at risk with US duties.

“There are a lot of small towns in Canada that have sawmills and are heavily dependent on them for the survival of the entire town,” says Jesse Marzouk, a forestry specialist at Hilco, an asset valuation company in Northbrook, Ill. “It’s an important part of the Canadian economy.”

On the political trail, trade with China draws more attention. It runs a much greater trade surplus with the US ($356 billion last year) than Canada does ($15 billion), displacing domestic manufacturers at a rapid clip. It’s also a geopolitical rival, widely accused of pirating US intellectual property, restricting market access to US firms, and protecting national champions in key industries like steel, energy, and mining.

But on the ground, in places like Madison, Canadian imports can generate just as much angst as any community that finds itself on the losing end of international trade.

For Madison Paper, the prime villain is a government-supported mill in Nova Scotia that produces the same type of glossy paper at a cheaper price. “We’re losing jobs in America,” says CEO Russ Drechsel. “It’s an unfair trade. I don’t believe in subsidies.”

A logging truck races through Maine's North Woods with a load destined for a mill.

Robert F. Bukaty/AP/File

On a recent morning before the closure, he takes a walk through the mill, which sits on 30 acres that hug the Kennebec. A giant roll of proto-paper the width of a bus spins on cylinders, then passes through roaring dryers that wring out the pulp’s water and bond the fibers together. The heat required to steam and dry the paper, as well as to pulp the logs that start the process, means that the mill consumes roughly double the power that its two hydropower dams produce.

Inside a control room, Mr. Dreschel talks to workers about their severance and benefits and asks if they had all the information they needed. He notes that he has employees who followed their parents into the mill; one young recruit who joined in 2015 was both son and grandson of Madison mill workers. And each job supports as many as five in Madison and other towns, from restaurants to barber shops to realtors and mechanics.

How a trade 'war' looks from the inside

Madison Paper’s specific problems began in 2012, when the provincial government in Nova Scotia stepped in to rescue a bankrupt paper mill, providing loans and subsidized power to save hundreds of jobs in Port Hawkesbury.

By 2015, Madison was reducing shifts and idling machinery after a severe winter that drove up energy prices. Together with another paper company it filed a petition to the US Department of Commerce seeking import duties on the Port Hawkesbury mill for unfair subsidies. Last November, the petitioners won their case: The US imposed countervailing duties of 20 percent on imports from the Nova Scotia mill. (An appeal is pending.)

But it came too late to save Madison Paper from closure. Dreschel says that even with the import duties on Canadian paper, it would be hard to beat it on price because the strong US dollar makes Canadian imports much cheaper. “That was the final straw,” he says.

Maine’s paper dispute is a cousin to the bigger dispute over subsidized lumber. The Softwood Lumber Agreement, a complex tariff and quota system that kicked in when harvested lumber fees in Canada fell too low, was supposed to resolve the controversy. Signed in 2006, it was extended in 2012 – Mr. Kirk signed the agreement – and then expired last October.

US lumber companies have threatened fresh legal action. During a summit in Ottawa Wednesday where President Obama and Mexican President Enrique Peña Nieto met with Canadian Prime Minister Justin Trudeau, the US and Canada released a statement saying that "significant differences" remain, despite progress in intensive talks. If the two nations can't reach agreement by October, US companies can initiate new trade cases.

Trade and trust

Both countries have strong incentives to settle. US exports of goods and services to Canada supported an estimated 1.7 million jobs in 2014, according to the Department of Commerce (the latest data available). In the past, the US and Canada have butted heads over prescription drugs, beef, and other agricultural products, but Kirk points out that trade disputes with Canada and Mexico under North American Free Trade Agreement (NAFTA) rules make up a small proportion of total cross-border commerce. There’s also trust.

“There’s an enormous amount of good faith there,” says Matt Gold, a Fordham University law professor and former deputy assistant US trade representative for North America who had oversight of lumber talks with Canada. “So even the most complex and contentious of issues can be resolved fairly.”

Maine also benefits specifically from US-Canada trade. According to Canada’s government, 38,500 jobs in Maine depend on trade with Canada and cross-border investments. Maine exports $1.3 billion in goods and imports $1.9 billion. Top export items are fish/lobster, wood products, paper, and aircraft. Maine tourism, which supports 94,000 jobs, or 14 percent of the state’s total employment, relies on Canadian visitors for nearly one-third of tourism-related retail spending: almost $450 million.

“Growing up here, we were always told that the day that mill closes up, we’re going to dry up and blow away,” says Tim Curtis, the town manager. The loss of Madison’s biggest taxpayer – assessed in 2014 at $80 million – is a blow, but it represents a fifth of the town’s tax base, much less than in the past. He says some of the mill’s skilled workers had been getting offers from other paper mills in Maine. The town is hoping to find another tenant for the mill site, though it’s more likely that a buyer would only want the hydropower plants. “It won’t be easy. It’s a loss,” he says.

Madison’s second-biggest taxpayer – soon to be its first – is Backyard Farms, a greenhouse tomato grower that supplies Whole Foods and other grocery stores and employs around 200 workers. On its website, the company says its business was hatched out of a desire to replace imported winter tomatoes from Canada and Mexico with fresh tomatoes grown in New England.

At a diner across the river from the mill, two senior workers finish up breakfast before the start of one of their last shifts. Art, a millwright in his early 60s who has worked at Madison for 20 years, describes how he feels about the job he’s leaving: “It’s hot. It’s noisy. There’s long hours. When something is broken, it’s gotta get fixed.”

Art and his companion declined to give their surnames, saying their union had asked members not to talk to the media while severance packages are being worked out. Art says he plans to retire and move to southern Maine after the closure. “The way the paper industry is going in this state, it was a surprise, but not a big surprise,” he says.