Say you have a website about dogs and you wrote an article on space travel. Would that affect your site in anyway, or backlinks are backlinks and it does not matter?
google tries to make sure your links are contextual, it will still give you some + points, just not as much as if the article about space travel was written on a website about space travel, get it?