How can the City of Chicago have two pro baseball teams?

Do both teams play in the city of Chicago or the Suburbs?

Chicago is a very small city, how can it be?

What about the New York Mets and Yankees, do they play in New York City, or the suburbs of New York?