The actual formula for how Facebook prioritizes your friends isn't known. We can assume however that they have a prioritized list of our friends somewhere and that it's a combination of the social actions you make (eg who you message most often, who's profiles you visit and for how long, who's status/images you like, etc). A friend showed me what he thought was this list as it's found in the source code of everyone's logged in profile page.