Density yes, but more importantly 1) speed vs traveling by car, 2) starting and stopping in places people want to travel between, 3) safety, 4) real estate prices/regulation.
Density goes to number 1 (more traffic = better reason to use the subway) and 2 (more likely to be able to serve people’s desired trip)
5) Weather. If it's under -20 C or over 40 C, walking five blocks is unpleasant for anyone and dangerous for some. Especially if the walk is unsheltered, which it typically is.