Farming and Staking are 2 different things and they both have different characteristics which distinguish them from each other. Lets do a breakdown analysis and see how they differ.
They differ in what ways exactly?
Farming or Token Yield Farming is when an investor deposit his/her funds in the liquidity pool with the intention of earning returns which are calculated as APYs. Lets say you deposit your DAI in Harvest Finance and you start farming and you will earn more DAI and iFarm. It can also be done when you deposit your funds in a lending platform such as AAVE. Mostly investors get rewards in trading fees for providing trading liquidity.
Staking it is when investor lock their funds so as to help in block verification and they get rewards for that. Lets say you buy you Atomic Wallet Tokens and you stake them in your Atomic Wallet for some period and then you will be earning your returns. This is done since most tokens are now using Proof of Stake an not proof of work.
Pros & Cons
These 2 operate differently and the risks involved are different. Yield Farming is a lucrative investment but its is a high risk investment as-well because there are impermanent losses involved. Your might end up regretting farming and for that reason that is why the APYs being offered are so huge.
Staking is safe as there are no risks involved , the only risk comes when you decide to stake your tokens on Centralized Exchanges and if those exchanges are hacked they you will definitely lose you crypto assets.
These 2 have their differences so if you are a high risk investor then yield farming is the way to go but if you are those types of investors who do not want to take risks then token staking is the way to go.