Yearn Finance functions as a yield aggregator, designed to automate and simplify complex DeFi investment strategies with the objective of generating the highest returns with minimal effort. It achieves this by continuously shifting funds between various underlying protocols, such as Compound, Aave, and Curve, to capture optimal yields.