HN doesn't have an algorithm, per se.
There are voting mechanics, and some sites gain or lose a penalty based on content or type (most generic news sites, for example, are slightly penalised). There are keyword / topic penalties too for issues that are dominating the hivemind for a period.
But mostly what you're seeing is simple mass-media power-law effects, along with early-action advantage:
- Votes / article tend to follow a power-law curve, where the frequency of high votes is inversely related to the vote. This typically shows as a linear relation when the log of both values is taken (log(frequency) vs. log(votes)). There are 30 front-page slots on HN, about 11,000 opportunities per year (at day's end, more if you count intra-day appearances), vs. about 400,000 submissions (see: <https://whaly.io/posts/hacker-news-2021-retrospective>). Most submissions won't make the grade, often through no fault of their own. I've looked into this in some detail, including looking at votes/comments by story position (there's a sharp decrease here as well).
- A small amount of early activity (upvotes, flags, comments) tends to have an outsized effect on the trajectory of a given story. Low-quality comments are particularly deleterious, and are hunted aggressively by mods for this reason.
- Stories often do far better on a subsequent submission. Part of this is probably randomness, part also a familiarity effect among those reviewing the "New" queue. If at first you don't succeed ... try again, a few times, at least.
- Stories can get selected (or nominated for) the Second Chance or Invited pools. These increase odds of landing higher on the front page, and are used fairly frequently. See "pool" <https://news.ycombinator.com/pool> and "invited" <https://news.ycombinator.com/invited> under "lists".