Airbnb, a company that enables homeowners to rent out all or part of their homes to travelers, has been fighting a lot of legal battles recently. The company has benefitted both vacationers looking for cheaper accommodations, and homeowners hoping to earn some extra cash. But many cities have laws against rentals such as the ones made possible through Airbnb, and as a result many of the homes available on Airbnb are there illegally.

What kind of laws? Some cities don’t allow renters or homeowners to host paying guests for short periods of time, or may require hosts to be in a registry or have a permit or license. Many municipalities also charge occupancy taxes. Airbnb helps customers in some tax jurisdictions figure out the costs of these taxes, but this service does not extend everywhere.

Right now, one of the biggest battles is surrounding New York City. New York State laws forbid rentals that take place for fewer than thirty days without the owner present. Additionally, many lease agreements require tenants to obtain permission from the landlord if they want to sublet their apartment. Some municipalities require that guests pay taxes. And in some cases, those wishing to lease their property must actually change their zoning, changing their property designation from “long term housing” to “hotel.” But the low prices that Airbnb uses to draw customers stem at least partially from the fact that those renting their homes do not have to pay the same costs that hotels do.

Why do these regulations exist? One of the consequences of Airbnb’s business model is that it encourages gentrification at an especially rapid pace. Those who can afford it can buy up multiple properties in cities to rent on Airbnb, with none of the regulations or charges that hotels must deal with. This can seriously inflate rental costs, forcing tenants to find other places to live. The strict rules regarding rental and land ownership in cities such as New York are designed to slow the pace of gentrification.

Still, regulations don’t work if no one follows them. So New York Governor Andrew M. Cuomo signed a bill that would fine hosts heavily for illegally renting out their homes. In retaliation, Airbnb sued New York. Airbnb is also embroiled in a number of other legal disputes with cities such as San Francisco and Santa Monica in the United States, and Amsterdam, Barcelona, and Berlin abroad. All are that have felt the effects of especially rapid gentrification, and taken moves to combat it, either by heavily regulating rentals, or banning them entirely.