New York City is famous for its food culture, whether it’s a $500 tasting menu at a Michelin-starred restaurant or a bodega bacon, egg, and cheese. It’s possible to find food from every corner of the world, no matter how obscure. Restaurants make, and sometimes unmake, entire neighborhoods.

This is a city that eats out. But that wasn’t always the case. Rewind just over 200 years, when New York was caught between being a Dutch colony and a city, and dining out was a rarity. As the city urbanized, how its residents ate profoundly changed.

“Food serves as a nice medium to take a step back and look at the bigger picture of New York City history,” says Victoria Flexner, the founder of Edible History, a supper club that creates dinners themed around specific historical moments. Recently Flexner and chef Jay Reifel hosted a meal at the James Beard House that told the story of New York City’s urban development in the 19th century through how its residents dined out.

“Experiencing how we ate historically—how much, how often, what kinds of dishes and who prepared them—not only teaches us something about the time and culture and economic status and season, but also [gives] it a more personal context,” says Izabela Wojcik, director of House Programming at the James Beard Foundation. “[Food] makes it relatable or brings out a curiosity and emotion that other forms of history may not.”

Grueling commutes redefined lunch

Development is a constant throughout the history of New York, and it was especially rapid during the 19th century. In 1800, the city had a population of 60,000; by 1900 it had swelled to 3.4 million people. During this time period, the urbanized area grew from lower Manhattan (essentially below 14th street) to the entire island. When city commissioners laid out the street grid in 1811, they assumed it would take several centuries before growth reached 155th street. But by 1860, development already stretched that far.

As the city’s population spread across Manhattan, the dining habits of New Yorkers also shifted. In the 18th century, dining out wasn’t common, as Flexner explains. Restaurants as we know them didn’t exist and people mostly ate at their homes. Only travelers ate out and their options were taverns and inns that served limited menus at set times. Lunch was usually the main meal of the day and businessmen traveled back to their homes to eat.

As the city’s population grew, streets became congested and commutes became too long to accommodate a mid-day meal. Oyster cellars opened up throughout the Financial District to feed this segment of the population. Everyone—rich and poor—ate oysters at the time, but most cellars weren’t nice establishments.

One establishment would change that: Downing’s Oyster House, which opened on Broad Street in 1825. Its proprietor, Andrew Downing, was African American and an abolitionist, and became one of the most respected business owners in New York. He catered to the city’s elite and outfitted his establishment—which was also a stop on the Underground Railroad—with carpets, chandeliers, and curtains.

Establishments serving food became more sophisticated as the 19th century progressed. Delmonico’s, which is still around today, opened in 1827 and allowed customers to order whatever they wanted from the menu instead of getting a fixed meal, as was customary. The restaurant moved around the city throughout the 1800s and its chosen locations often predicted where urban growth would be concentrated.

Industrialization and the mobile food cart

As the city became rapidly industrialized in the 19th century, a new system emerged to feed these workers: the mobile food cart.

While politicians, businessmen, and other white-collar workers went to oyster cellars and restaurants for their midday meals, lunch came to the working class. Vendors would park outside of factories and docks and, for a few pennies, would sell items like gingerbread, yams, oysters, and corn.

“When you eat at a street cart of food truck today, you’re participating in an old tradition,” Flexner says.

A city of boarders—and bad food

Housing has always been a challenge in New York City, and in the 19th century, many people turned to boarding houses, which catered to different races, ethnicities, genders, and social classes. They became the standard destination to the city’s newcomers, especially young people. Some historians estimate that between 30 and 50 percent of all urban residents in 19th century America lived in boarding houses at some point in their lives.

“A whole portion of people living in boarding houses fundamentally changes their relationship with food,” Flexner says.

Many boarding houses weren’t pleasant places to live and offered bare-bones accommodations: a place to sleep and wash up—and bad food. Even the nicer places didn’t offer enough to eat. Boarders needed places to eat and to socialize, which sparked demand for more restaurants. Additionally, the traditions around marriage were changing—arranged marriages were phasing out—and young residents wanted establishments where they could date.

Ice cream saloons, which served unaccompanied women, cropped up around the city and offered hot meals and sweets. Many of them adopted domestic touches like drapes, armchairs, and stonework, signaling that they welcomed women. By the end of the 19th century, restaurants that catering to women was good business and more spaces became available for them.

Today, New Yorkers of all stripes have an abundance of eateries available to them. They’ll continue to morph as the city grows and changes. Consider food halls: they’re a byproduct of competitive real estate and changing tastes in dining experiences.

“If you look at evolving food trends, it’s such an incredible window into bigger concepts as opposed to starting with the minutiae,” Flexner says. “Instead of starting small and zooming out—like looking at one building or a neighborhood—food is all there at once: culture, immigration, gender, and religion.”

So the next time you trek to a new restaurant, consider the urban development forces that brought it there.