California and Arizona are currently fighting each other over water from the Colorado River. But this isn’t new — it’s actually been going on for over 100 years. At one point, the states literally went to war about it. The problem comes down to some really bad math from 1922.

To some extent, the crisis can be blamed on climate change. The West is in the middle of a once-in-a-millennium drought. As temperatures rise, the snow pack that feeds the river has gotten much thinner, and the river’s main reservoirs have all but dried up.

But that’s only part of the story: The United States has also been overusing the Colorado for more than a century thanks to a byzantine set of flawed laws and lawsuits known as the “Law of the River.” This legal tangle not only has been over-allocating the river, it also has been driving conflict in the region, especially between the two biggest users, California and Arizona, which are both trying to secure as much water as they can. And now, as a massive drought grips the region, the law of the river has reached a breaking point.

The Colorado River begins in the Rocky Mountains and winds its way southwest, twisting through the Grand Canyon and entering the Pacific at Baja California. In the late 19th century, as white settlers arrived in the West, they started diverting water from the mighty river to irrigate their crops, funneling it through dirt canals. For a little while, this worked really well. The canals made an industrial farming mecca out of desert that early colonial settlers viewed as “worthless.”

Even back then, the biggest water users were Arizona and California, which took so much water that they started to drain the river farther upstream, literally drying it out. According to American legal precedent, whoever uses a body of water first usually has the strongest rights to it. But other states soon cried foul: California was growing much faster than they were, and they believed it wasn’t fair that the Golden State should suck up all the water before they got a chance to develop.

Read the full article about the Colorado River crisis by Jake Bittle and Daniel Penner at Grist.