It takes into account historic data as well nowadays. If people landed on a page often, that one is likely to get pushed to the top. There's probably a lot more layers to it I don't even know, honestly. But that's why they try to piggyback stuff off of already popular pages.