Donald Trump is locked in a dispute with a Scottish couple who refuse to sell their home to make way for a golf course. To pressure the homeowners, Trump built a fence around their house and sent them a bill for half of the construction costs. Can your neighbor force you to pay for a fence you don’t want?

Yes, in some places. Fence laws originated with disputes over livestock, which may wander off their owner’s land and cause damage. Judges and legislators have developed three different schemes for allocating the costs of restraining animals. Countries or states with “fence-in” systems require ranchers to build and pay for fences to keep their cattle on their land. “Fence-out” regimes allow livestock to go where they please, and impose the cost of fencing on neighbors who don’t want animals on their property. Lastly, a few Solomonic legislatures have split the difference, forcing neighbors to share the cost of a fence, even if one of them doesn’t want it. But don’t be alarmed, suburbanites. Most states restrict their fence-out and cost-sharing rules to less populated regions or to those who own livestock, so your neighbor probably can’t stick you with a bill for the cost of his white picket fence. As Robert Frost famously noted, there’s no need for good fences where there are no cows.

While requiring landowners to chip in for their neighbors’ fences seems intuitively unfair to most people, fence-out and cost-sharing systems work in certain settings. As the pioneers moved west in the 19th century, they found vast, unused pastures. Ranchers argued that fencing in their livestock would waste all that valuable land. The overall cost to the economy would be less if animals were permitted to graze anywhere, with farmers and other landowners simply fencing off the territories where the cattle weren’t welcome. Cost-sharing systems can also help prevent shenanigans. They stop cheapskates from using their neighbors’ fences to pen in their own livestock for free.

Scotland has technically been a cost-sharing country since the March Dykes Act of 1661, which requires neighbors to share the costs of “building, ditching, and planting the dyke which parteth their inheritance.” Few Scots invoke the hoary statute these days, so it’s not clear whether Trump will be successful. His opponents should have a strong counter-argument. The law exempts nonconsenting neighbors if the cost of the fence is disproportionate to its benefit. As long as the homeowners don’t keep livestock that might wander onto Trump’s 18th green, it’s hard to see the value of the fence.

While the clear trend in the United States is toward the fence-in requirement, there are still a number of holdouts. New Mexico, for example, is a fence-out state (PDF). Illinois imposes cost-sharing in the rural parts of counties with fewer than 1 million residents. (That’s every county other than Cook.) Rather than splitting the cost down the middle, the state sends “fence viewers” to determine a just distribution.

The Trump incident isn’t the first time that fence-cost-sharing laws have broken into the news. In 1989, a Virginia cattleman named Frederick Ames demanded that his neighboring ranchers split the cost of his fence, which cost tens of thousands of dollars. When the neighbors claimed poverty, Ames allegedly offered to take some of their land as payment. Eventually the dispute escalated. When a neighbor entered Ames’ land to retrieve his wayward bull with a herding stick in violation of a court order, Ames first warned him, then shot the man dead. Ames pleaded self-defense and beat the murder charges.

Got a question about today’s news? Ask the Explainer.