The recent showdown between ride-sharing service Uber and New York City Mayor Bill de Blasio provides a vibrant illustration of what we economists call “public choice”—basically, the study of politics through the lens of economic theory. Mayor de Blasio attempted to limit ride-sharing drivers, but Uber exposed this proposal, unleashing thousands of New Yorkers onto city council. After a weeklong public debate, de Blasio dropped the proposal. Uber’s strategy, de Blasio’s forfeit, and even the actions of Governor Andrew Cuomo and Comptroller Scott Stringer provide important lessons for our nation on the dangers of idealizing politics.

In the public choice framework, politicians are in the profession of maximizing votes, staying in office, and increasing campaign contributions. As a result, elected officials often face a tradeoff between satisfying public wants and catering to special interest groups, which donate to campaigns and lobby to politicians in order to advance their own goals.

This was de Blasio’s debacle, and Uber’s strategy in response was brilliant. Ideally, de Blasio, who has received more than $500,000 in campaign contributions from the taxi industry, wanted to sweep his Uber cap proposal under the rug. Uber is quite popular in New York City and de Blasio may have wanted to cater to the special interest of the taxi companies without stirring backlash from his constituents. If de Blasio truly cared about road congestion (which became the public justification for the cap) and thought it was popular to demonize Uber, he could have been vocal about this position upfront. It looks good for a politician to trumpet favored positions—such as vilifying Wal-Mart and Wall Street, both of which de Blasio has criticized.

By going public with the proposal, Uber forced de Blasio to factor in the cost of catering to special interest groups. Uber’s strategy was a classic example of placing public pressure on politicians. This was why de Blasio had to provide a public justification for his proposal. He even wrote an op-ed that read much like a debate strategy of throwing mediocre arguments against the wall and hoping some of it will stick.

So, New Yorkers, who love their Uber and detest their nonexistent taxicabs on a rainy day, blasted this issue with a typical Big Apple uproar. Now what? De Blasio knows that ultimately the public elects him. And it’s too risky for his goal of staying in office to satisfy his special interest constituents. So he raised the white flag and downloaded the Uber app.

But why did Governor Cuomo and Comptroller Stringer side with Uber? First, it’s a popular position to hold, and few politicians want to miss an opportunity to rally around a fashionable flag. But more importantly, taxicab companies have no interest in providing campaign contributions to Governor Cuomo because the taxi medallion system is a local issue, not a state issue. This means that the mayor and New York City Council have discretion over important aspects of the taxi industry such as the number of taxi medallions and the barriers to entry for new competitors.

As a result, Governor Cuomo isn’t tied to the special interest of taxicab companies. But Stringer’s opposition to de Blasio is interesting as it stirs some speculation that Stringer may intend to run against de Blasio in the near future. In the game of politics, it makes sense for Stringer to side with Uber to boost his popularity.

What can we learn from this Uber fight and public choice economics? We need to have a more practical understanding of politics rather than indulging in a romantic notion that all policies intend to help residents or consumers. We often get bad policies because of self-interested exchanges between politicians and special interest groups. We shouldn’t fall head over heels every time politicians tell us they support a particular policy in order to “help the people.” Sometimes that’s just a façade for what is going on behind closed doors.

So when politicians tell us they want to limit ride-sharing to “protect riders,” residents should take this public justification with caution and not immediately assume that they’re doing it out of the goodness of their hearts.