Interest rates play a big role in your financial life. You pay them on loans and credit cards, earn them on savings accounts and certificates of deposit (CDs), and they’re a factor in the prices you pay for homes, cars, and other purchases made with borrowed money. However, it’s sometimes difficult to understand how they work and why they vary so widely.

In general, interest rates are determined in a free market economy based on supply and demand for funds. The supply of funds is influenced by the willingness of individuals, businesses, and governments to save and invest funds in productive assets. The demand for funds is influenced by the desire of households and businesses to spend more than they receive in incomes, which drives up interest rates in strong economic expansions. When times are tough, the desire to save and invest tends to decline, driving interest rates lower.

The amount of interest due is calculated as a percentage of the principal sum lent, deposited or borrowed over time. Periods of time are typically one year, but can be longer or shorter depending on the type of loan or deposit. Three other variables determine total interest:

The first is the financial risk premium, which is a reflection of how much the lender may be concerned about not being fully repaid. The second is inflation, which can affect the value of the money over the term of the loan. The third is the debt-to-asset ratio, which relates to how large of a buffer of equity there is before impacting a business’s ability to repay its debts.