Farms generate yield for liquidity providers that stake the LP tokens. They are meant to incentivize long term liquidity by providing an additional revenue stream for providers. The rewards for farms are usually provided in MEX tokens, but special farms with dual token rewards can exist.
Liquidity providers can use farms by staking the LP tokens obtained from providing liquidity in a pool. After doing this, MEX rewards will periodically become available for harvesting. The rewards can be locked for 1 year for 2x APR.