A quirk of geography that snowballed.
So, back in the 17th century, European powers were scrambling to find land in the new world. I’m going to leave what’s now Canada out of this because its geography is distinct as well (so more about why Montreal is important isn’t worth talking about), so I’m going to concentrate on the United States.
Now, there are numerous ports on the U.S. east coast, but the vast majority of them suffer from two major problems - waterfalls and mountains. If you go up a river from a typical U.S. Atlantic port, you soon find a waterfall in your way. After you get over the falls, there’s a string of mountains to deal with.
A map of where sudden increases in elevation from the coast creates waterfalls. Those orange areas are the mountains.
It’s why New Orleans was so important in early U.S. history - you can literally navigate for thousands of miles by boat without hitting a waterfall.
But there is one massive exception to the east coast rule that mostly hems in cities built there - New York. There, the Hudson River runs flat for a couple of hundred miles north to Albany before you see any falls. Once you get there, you find a gap in that mountain range, which in the beginning you could move stuff in carts.
Because New York City had an inland river next to its harbor, it became the go to place to move things in and out of the United States. Back in the day, most of the land around New York Harbor and the East and Hudson Rivers was very low lying wetland. Manhattan, on the other hand, sat on a massive hunk of rock and, at the time, has numerous small creeks that provided drinking water.
By the time the American War of Independence ended, New York, which was just Manhattan at the time, had become the largest city in the United States as its harbour and connections north meant agricultural produce flowed into the city to be distributed elsewhere. Even southern ports started shipping tobacco and cotton to New York to be sent for export.
Then, in the 1780s, someone came up with an audacious idea to build a massive canal from Albany to Lake Erie through the gap in the mountains. It was too crazy an idea at first, but it was completed in 1825 and the agricultural riches of the areas surrounding Lake Ontario, Lake Erie, Lake Huron and Lake Michigan started flowing to the canal. Shipping costs from Buffalo to New York dropped by 95%. New York was now the gateway to the midwest and its economic importance grew alongside.
Meanwhile, with all that trade money coming in, New York developed as a banking, commodity and financial market. Cotton was grown in the South, but if you wanted it you went to New York. The Lehman Brothers, dry good dealers who started trading cotton in Alabama when cash was scarce, opened their first office in New York in 1858.
The New York financial market was kind of small scale until the start of World War I, which caused the collapse of all the European financial markets. Europeans flooded the American market looking for buyers and from that point forward New York rivaled London (which to be fair lasted a little longer than the others) became a major financial player. But long before that the fact that it was a first port of call for immigrants to the United States (70% of immigrants in this era came through New York) made it a major light industrial power, dominating garment making, publishing, and food processing. Starting with 33,000 people in the 1791 census, it blew past 1 million in 1880 and 3 million by 1900. In 1925 it became the largest city in the world, a distinction it held until 1954.
In 1898, New York was expanded to include the counties of Kings (Brooklyn), Queens, Bronx and Richmond (Staten Island). The Brooklyn Bridge had been finished int he 1880s, replacing ferries. The Staten Island Ferry had started in 1817 and was taken over by the city in 1905. Rapid transit had come to the city in 1868 with elevated trains. The subway came in 1904. 66% of all American imports and 39% of all American exports flowed through New York. The five largest banks in the United States were all in New York, as were the nation’s two largest stock exchanges, one of which was actually organized outdoors and eventually became AMEX.
Manhattan’s population peaked at 2.3 million in 1920, but by then it hardly mattered because the other four boroughs were growing quickly too. Brooklyn topped 1 million in 1900. Queens reached 1 million in 1930, as did The Bronx. It didn’t matter because most of those people, and hundreds of thousands more in other parts of New Jersey, Westchester County and Long Island were coming to Manhattan every weekday for work. The Long Island Railroad was offering commuter service as early as 1834. The New Jersey PATH was opened in 1908 linking cities on the Hudson to the financial district and midtown. On an average weekday, 2 million people come to Manhattan to work - more people than actually live in Manhattan now.
So, living close to the jobs comes at a cost. Ironically, a lot of housing (admittedly, a lot of housing that would not come close to meeting modern standards) disappeared after the 1930s as it was either too run down to live in or was torn town for modern housing. It’s also easy to get to Manhattan from elsewhere in the metro area without a car.