Start with the rank nobody associates with New York City, because it complicates the story everyone already knows. In the 1790s, New York was the seventh-largest port in the United States -- a real city with a real harbor, but not the obvious future capital of American trade.[1] Philadelphia, Boston, and Baltimore all had working, well-established ports of their own. Nothing about New York's waterfront made its eventual dominance inevitable.
What actually changed the outcome was a specific person's specific project, mocked at the time as "Clinton's Folly." Governor DeWitt Clinton had drafted the "New York Memorial" in 1816, a petition backed by 100,000 New Yorkers, to build a canal connecting the Hudson River at Albany to Lake Erie at Buffalo.[2] Construction began in 1817 and finished in 1825, at a cost of $7 million -- fully repaid from canal tolls within the first nine years of operation.[2] No federal government built this. No private company financed it. New York State did, on its own initiative, betting an enormous sum on infrastructure a lot of contemporaries thought was a waste of public money.
The canal didn't improve New York's trade. It redirected the entire Midwest's trade through New York, because nothing else came close on price. Once the Erie Canal opened, the cost of moving a ton of cargo between Buffalo and New York dropped from $90 to $4 -- a 95% reduction -- and the trip itself shrank from three weeks to eight days.[3] Wheat moving through the canal went from 3,500 bushels in 1829 to 500,000 bushels by 1837.[3] In 1824, the year before the canal opened, 157,000 tons of goods moved down the Hudson into New York Harbor; twelve years later, eastbound tonnage from the West had nearly quadrupled.[1] A Midwest farmer or miner sending goods east didn't choose New York out of loyalty or habit. New York was simply, overwhelmingly, the cheapest way out.
The settlement pattern that followed ran on the same logic, in the other direction. The canal didn't just move goods east -- it made the newly accessible Northwest Territories worth settling in the first place, because a farmer there finally had a cheap, reliable route to sell a crop on the Atlantic coast. Michigan, Wisconsin, Minnesota, Illinois, and Indiana all saw settlement accelerate on the strength of a trade route that ended in one specific harbor.[3] By 1830 New York held the port rank it has never given up since -- not because the Atlantic Ocean changed shape, but because a state government had already made every other route to it structurally more expensive.