Link farming as the name says can be seen as a farm to raise links to websites.
As for Search Engines, they assume that if more websites link to yours, the higher should be your rank in their results since more inbound links indicate a higher level of popularity for your website in the Internet space.
Imagine you create a website and allow other websites to place a link on your website, no matter what they service or sell from their website, where there will be no categories or groupings of any sort, just thousands of links all placed serially into the same page, the whole idea being to just provide inbound links to websites which pay for this service, thereby tricking search engines by making them believe these to be genuine inbound links for those third party websites. A link farm does not have any content or useful information anywhere on their site. They are there just for the sake of providing links for other websites. This certainly is a black hat seo technique that was prevalent for quite some time, but has now been mostly withdrawn since search engines are now aware of it and has started banning websites that are listed with such farm websites.
Adding a link to your website on a link farm can cause your site to be penalized by the search engines as well.
Inbound link analysis has been followed by major search engines to measure a site’s popularity in the internet. Every inbound link would add as a vote to that website. However the quality of the website which provides the links also matters. Certainly link farms come under black hat seo technique and by any means avoid getting your website listed with such illicit sites.