I added population density and tests per positive case to my spreadsheet (which is just the Worldometers raw data). Not sure how to paste as an actual spreadsheet (it's a snipped picture from Excel) so people could actually use the data. While Japan is a good question, South Korea is even more densely populated and had a big early outbreak, yet they still controlled it. The really amazing cases, to me, were Singapore and Hong Kong, which are 10-50X more densely populated than almost every country on that spreadsheet and as densely populated as NYC and yet they've had essentially trivial levels of cases (even with recent flare-ups).
Both have very strong mask-wearing cultures and Hong Kong did an incredible number of tests per case. In fact the top 8 countries in tests per case (meaning one is getting a ton of very mild/asymptomatic positives and usually tracing them to ensure they don't infect others) all have <6 deaths/1MM. The only outlier is Denmark, which has the 9th most tests/positive case, but does not have a strong mask wearing culture and has ~105 deaths/1MM.
Japan and Singapore are similar in that they have very low deaths/1MM, but don't have unusually high tests/case, but do have extremely strong mask-wearing cultures. The US is #31 of 42 in that spreadsheet in tests/case - we've run a lot of tests, overall, but this stat is indicative of always being behind the case curve. Ethiopia, Kenya and Nigeria are the only countries with <10 deaths/1MM that don't have fairly high tests/case, although to be frank, I'm not sure we know enough about their data collection to know if their data can be trusted.