I wouldn't attribute it solely on moderation though. The HN audience isn't very big and thread discussions never last too long because there's almost always something on the frontpage. Not saying it's a bad thing though.
HN gets 1400-ish submissions and 12,000-ish comments a day, and 5M-ish users a month. Whether that's big depends on what you're comparing it to. It's big to us.
HN is probably the only place that maintained its quality somewhat over the last 10 years for me. So many websites and subreddits blew up, grew too quickly, and burned out in quality.
I think a lot can be attributed to strict moderation, but also like you say being pretty niche helps in that the mod team doesn't have to be very big.