Derivatives like Yearn and Stakedao work by allowing users to stake their tokens in order to earn rewards. Yearn and Stakedao offer a variety of staking options, such as lending, yield farming, and liquidity pools. When users stake their tokens, they are locked up in a smart contract and are not accessible until they are withdrawn. This means that users are able to earn rewards without having to worry about their tokens being stolen or lost. Stakedao also offers a variety of features such as staking rewards, governance, and automated market makers. These features make it easier for users to manage their staked tokens and maximize their rewards.