Link farming as the name says, can be seen as a farm to raise links to websites.
As for Search Engines, they believe that if more sites 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 site, 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 their websites, thereby tricking search engines, making them believe these to be genuine inbound links for those third party sites. A link farm does not have any content or useful information anywhere on the 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 withdrawn since search engines are now aware of it and has started banning websites that are listed with such farm websites.
Inbound Link analysis has been followed by major search engines to measure a site's popularity on 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 site listed with such illicit sites.