Before the memory of the recent debt ceiling negotiations disappears and we confront the next new drama in Washington, let’s pause a moment to acknowledge what just happened. You can debate from here to eternity whether the American people were winners or losers in the deal (I’d say winners because the government didn’t default, losers because we had to go through the whole charade in the first place) but what’s not debatable is one key point: Congress and the White House provided a lesson in how negotiations and bipartisanship are supposed to work.

 We live in an era when this can seem impossible, as hard-line conservatives in the GOP and a few determined progressives in the Democratic Party try to push policy to the extremes and appear to reject the idea of even talking to the other side. But Washington has a way of imposing the discipline of hard numbers—in this case, a House controlled by Republicans with a bare majority; a Senate with a very small Democratic margin; and a presidency in Democrats’ hands. For either side to make progress, they have to negotiate with the other.

 What’s easy to forget is that this has been the norm for more than a half century. Of the 28 Congresses since 1969, 19 have been divided (if you include the 107th, which began and ended under unified Republican control, but for most of its two-year length was divided because of a senator’s party switch).

 Anyone who’s spent time in the nation’s capital during this long era of mostly divided government knows that with power so distributed, there is no single path to success in trying to make the Congress work. As long as they’re playing by the rules, the chief way to judge success is by the results. And on that front, the debt ceiling debate was a success—even if the harder-core members of the GOP caucus in the House are now trying to punish Speaker Kevin McCarthy for the deal he struck.

 You may know the broad outline of the agreement: It buys the government two more years before the next debt ceiling clash; imposes a freeze on some federal spending; broadens work requirements for food stamps; and makes other changes designed to appeal to either Republicans or Democrats. As The New York Times’ Catie Edmondson wrote after it passed, “The compromise was structured with the aim of enticing votes from both parties. It allowed Republicans…to say that they succeeded in reducing some federal spending—even as funding for the military and veterans’ programs would continue to grow—while allowing Democrats to say they spared most domestic programs from the severe cuts.”

 This allowed both McCarthy and President Joe Biden—and their parties—to claim victory. In a set of negotiations like this, that’s actually what you’re aiming for: the ability for everyone to walk away saying, “This is what I’ve done for you.” It’s a classic illustration of how democracy works, especially when political leaders are content to share credit. In an analysis after the bill passed, longtime Times Washington correspondent Peter Baker noted, “The president’s approach to the negotiations—and especially their aftermath—reflects a half-century of bargaining in Washington. When someone has been around the track as long as Mr. Biden has, resisting the temptation to spike the ball and claim victory can be critical to actually securing the victory in the first place.”

 The recent floor rebellion by some disgruntled members of McCarthy’s caucus is a reminder that none of this is easy. But the overwhelming majority by which the debt ceiling compromise passed in both houses is also a reminder that, when the chips are down, many members can remember a key fact about life on Capitol Hill: You have to be flexible and work with what you can patch together when you’re trying to lead the country. That’s what our system offers: the chance for political leaders to do their jobs and make democracy work.

Lee Hamilton is a distinguished scholar with the IU School of Global and International Studies. He was a member of the U.S. House of Representatives for 34 years.