HN is mostly non-profit (it does drive attention and reputation to Y Combinator though).
It's selling start-up founder visibility, as well as pulse-checking both the community and those who'd seeek to influence it. A recruiting bonus as well "who's hiring", and HN startup pitches.
Ads? 3rd-party tracking?
There are ads (links to job postings of YC companies). They appear like regular submissions, but you can't vote or comment on them.