Relevance too is a factor. Google (and other SE's) like to see the link between the links (no pun intended). For example, if you have a site about domain names, then it makes sense for another site about hosting to link to you, but if you have a website about Peruvian toothpaste recipes linking to you, Google automatically assumes the link is only there in an attempt to boost ranking. You wont specificaly get penalised for such a link, but it will carry less weight.