All deposits and withdraws are algorithmically optimized to create a sustainably best interest rate. It works by churning each deposit and withdraw into the best yielding protocol and out of the worst yielding protocol, while taking the amounts into account. This results in all unused deposits, the balance that would otherwise be sitting in a smart contract waiting for borrowers, being fully optimized by achieving yield.
Think about this like churning butter, all the cream constantly rises to the top. On each withdraw, we remove any balance from the lowest performing protocol where balance is present to alleviate drawing the interest rate down. On deposits, we add to the highest yielding protocol, adding to the appreciation of the interest rate.
This interest rate achieved from this aggregation is the basis for all of the debt interest rates.