Why are there different interest rates on loans and securities?

Why are there different interest rates on loans and securities? Integrate and expand on the two major premiums that differentiate interest rates: the default premium and the maturity premium. Compare the difference of interest rates in types of loans to reflect different risks and times for repayment.