"Yield farming" generally refers to the provision of liquidity for various protocols. These protocols pay out money (mostly in the form of governance tokens) to Liquidity Providers (LPs) as a reward, which is also where the term yield farming comes from. A synonym for this would therefore be "Liquidity Mining".
As a subcategory of Decentralized Finance (DeFi), Yield Farming experienced a surge during the summer of 2020. Typically, it takes place on the Ethereum blockchain, as that is where the most liquidity is available. Yield Farming only became possible with an established decentralized infrastructure. This is because decentralized financial instruments such as lending protocols or decentralized exchanges (DEXes) need liquidity to function properly.
Total Value of Locked Collateral in DeFi Protocols
This liquidity is usually aggregated in so-called "Liquidity Pools". The funds from the pools are then lent to borrowers or, in the case of DEXs, used to trade assets. As a reward, liquidity providers get governance tokens proportional to their share of the pool. The first project to use Yield Farming on a large scale was Compound (COMP).
As an entire DeFi ecosystem formed over the course of 2020, there were also respective differences between the yields of different protocols. The project "Yearn Finance" took advantage of this fact. It works as an "intelligent savings account", so to speak, by selecting the protocols with the highest yields. Liquidity is then deposited there until a new opportunity presents itself.