There are several possible sources for the interest:
Your deposited crypto is lent to margin and short traders. A part of the loan interest the traders pay is then payed to you. If you deposited stable coins, they are in some cases lent to someone who takes a loan. A part of the loan interest the borrowers pay is then payed to you.
In other cases interest providers like new exchanges or projects offer interest to attract new users. Finally the interest is earned by using your crypto for staking.