The urban idea of stacking people's homes one on top of the other is very old: The Romans thought of it; so did the Egyptians. In European cities and in New York, by the early 1800s, the constraints of space meant squishing rooms for the lower classes into tenement buildings a few stories tall.
Apartments, though, were different. They were something in between—not the stand-alone homes and townhouses that were, in the 19th century, becoming the province of the urban rich and at the same time not a couple of rooms for large families, with a shared bathroom in the hallways. Apartments were for the middle class, the creative class. They were kind of cool.
If any city pioneered apartments on a large scale, it was Paris. Sharon Marcus, a professor of comparative literature, writes in Apartment Stories:
Throughout the nineteenth century, the apartment house dominated the Parisian urban landscape, inspired and worried domestic ideologues and urban planners, and provided fiction writers with settings… Their popularity owed much to two factors: They provided spatially compact housing in a city with a rapidly increasing population and offered an expanding middle class opportunities for investing in relatively inexpensive and profitable properties.
More than London, Marcus writes, Paris in the early 1800s embraced the apartment. And when wealthy Americans came to Paris for their cultural education, their interest was caught by these "Parisian flats." In New York, nothing like that existed—a large, well-appointed space in a building that happened to be shared with other families. Tenements didn't have parlors.