This is quite a diverse and complicated question, given there are so many different markets with so many different types of interest rates. I'll try to break it down into 3 main sections (for layman, for practitioners and for economists).
For layman: Interest rates are market prices for various types of money / money related assets (for amounts lent, deposited, or borrowed). Just like different types of cars have different prices, different types of money related assets have different interest rates. Yet, a car is a car, and you cannot charge 10 cents (you would not break even) or 100 million (no one will pay that much). Therefore, interest rates will more or less be similar and differences only exist due to differences in the products (liquidity, riskiness, length...). The times when rates do not move together is usually during turmoil. Flight to quality pushes interest rates of safe governments down, but credit concerns push up credit risky interest rates like Libor, Euribor, corporate bonds etc.
Central bank interest rates are the major benchmark. In the US, the federal funds rate is the interest rate at which depository institutions lend reserve balances to other depository institutions. If you need funding as a bank, this is one (quick) source. Generally, other short-term rates cannot go much above this short-term rate because it would not be attractive to use other types of funding if it were the case. If other rates would be substantially below that rate, one would borrow large amounts and invest at the higher interest on reserve balances (IORB). Likewise, if the federal funds rate is lower than the IORB rate, banks will borrow in the federal funds market and deposit those funds at the Fed to earn a profit on the interest rate differential. The increase in demand for funds in the federal funds market will pull the federal funds rate higher. Either way, the central bank rate will be an anchor for short term rates that all other short-term rates will follow closely, with more unfavourable condition (higher risk, less liquidity etc) asking for higher compensation / interest (e.g. pawn loans).
Medium to longer term rates: For example, the fed funds rate and the one-year Treasury rate track each other very closely.
On the other hand, the 5 year rate is a bit more independent but still moves up and down with the short term rates. The longer the tenor, the more important the investors' beliefs as to the direction of future interest rates and economic growth. Nonetheless, if the difference would become very large, say the 30 year US government bond would pay 50%, everyone would want to buy long term bonds (let us ignore default rates for now). Lots of buyers would drive up prices of bonds, thereby reducing yield again.
Also, the central bank directly affects these long-term yields via quantitative easing (QE), which involves large scale buying (or selling in case of quantitative tightening) of government bonds (and other interest bearing securities). Low short term interest rates are related to quantitative easing, and buying of bonds drives up prices, hence reduces yields. Likewise, increasing short term yields, and selling bonds (thereby reducing money supply) both put upward pressure on interest rates.
Different rates (other than government / central bank):
Adjustable rate mortgages (ARMs) are frequently linked to constant maturity rate (CMT) rates of US government bonds. If you just google
ARM Indexes and CMT rates you see plenty of results, like HSH. Generally, a bank needs to use some readily available benchmark to decide what the adjustable rate will be. Usually, banks will add a markup on top of the benchmark to reflect the (internal) rating and nature (liquidity, payout ranking in case of financial troubles etc). Another frequently used benchmark are (were since cessation) Libor rates and alternatives like ICE's Bank Yield Index and Bloomberg's BSBY Index (see swap rates below). To finance loans, banks can use deposits, can issue bonds, get funds in the interbank market, use repos or directly get money from the central bank. As you can probably tell, any means of financing that would be substantially more expensive (higher interest rate) will not be used by the banks to finance loans. The cost of financing naturally is the lower bound for loan interest rates. Fixed rate leans do not reset, but the initial rate depends very much on the same factors as variable rate loans on the date of issuance. You usually just pay a premium for the additional risk the bank has (reduced risk the borrower has) by offering a fixed rate.
Similarly, if a company wants to raise capital, it needs to be attractive for investors. If you were to pay a lot more than government debt, with reasonable risk of default, you would attract a lot of investors. Naturally, companies would want to pay as little as possible. They hire banks to manage their bond issuance. Bonds are often priced as spread over some benchmark swap curve and banks frequently quote perceived spreads to customers to show what the current market price for debt may be for them if you were to issue a new bond. As you can in the figure below (source, good ratings result in low spreads above government debt for companies.
In fact, most corporate bond pricing is set as some mark up over benchmark swaps or government bonds, see for example this Reuters article or this article. It is also a natural way to think about yield, as looking at say 6% in an isolated way tells you little about the specific yield (the short-term benchmark may be -0.5% or 18% for example).
Wholesale banks frequently use the swap curve because they predominantly use swaps to manage assets and liabilities on their balance sheet (also due to regulatory requirements like computing Interest Rate Risk In The Banking Book as well as Credit Spread Risk In The Banking Book (IRRBB & CSRBB).
Retail banks with little exposure to the swap market are more likely to use government curves as their benchmark.
Computing the NPV of a bond for risk purposes is also often based on yield curves. The idea is to start with a risk free interest rate curve (nowadays ESTR and SOFR for EUR and USD), which has yields for all sorts of tenors, and would be interpolated to the exact cashflow dates of the bond. On top of that, you add a curve for credit spreads that are usually sector dependent (e.g. EUR Utility BBB rated - which means you look at bonds of EUR denominated utility providers, that are BBB rated and compute a spread curve for these bonds). On top of that, you would have a firm specific spread. One of the main benefits of this approach is that it allows you to get different risk metrics (various shifts in general yield; from flattening, to steepening yield curves, different credit risk shifts etc). A natural logical implication of this approach is that interest rates are all tied back to risk free rates, and as such rates set by central banks and government bonds.
A related concept is to compute flat spreads (I-spread, z-Spread etc) over certain curves (government, OIS swaps etc).
- Swap rates / Futures: Vanilla interest rate swaps have a fixed leg and a floating leg, repricing to some interest rate (OIS rates (Fed Funds, SOFR, ESTR), 3m Libor, 6m Euribor etc). The swaps therefore need to price in what the market thinks the rate will be at some time. For this reason, interest rate futures / OIS rates for different tenors cannot be calculated from another (unlike the price of stock futures which is simply a function of the spot price, interest rates and dividends and as such contains no information that the spot market does not contain) and there is interesting information inherent in interest rate future prices because the price setting relies on market expectations. Typically, Libor rates have a spread relative to OIS rates because the former have more credit risk. As such, the Libor-OIS spread is widely used as a gauge of the creditworthiness of the banking system.
This spread also offers an example of when rates do not move together. Flight to quality and FED liquidity pushed SOFR down, but credit concerns in banking pushed up 3m Libor.
- Hedging: Yield curve factor models describe yield curve movements with certain (independent) factors. E.g. the three-factor model of Litterman and Scheinkman (1991) describe the yield curve with level, steepness and curvature. These 3 factors are frequently estimated with Principal Component Analysis (PCA), and level alone (upward or downward shift in the entire yield curve) explains well above 70% of the entire yield curve. This suggests indeed that rates move very closely with each other. Portfolio managers, interest rate risk managers at banks but also anyone issuing bonds who wants to get the best deal / cheapest interest rate, will be interested in the impact of unanticipated yield curve changes. E.g. effective duration measures a bond's sensitivity to small changes parallel change in the benchmark yield curve; key rate duration does the same at specific maturity segments. If the yield curve changes, the risk / return changes and some segments may become more / less attractive, resulting in movement of funds to different products. This will to some degree (within boundaries of risk, liquidity, regulatory requirements and so forth) result in a tendency of rates to not deviate too much.
For economists: The central bank mainly influences short term interest rates (at least traditionally, by directly setting rates like the Fed Funds rate). The longer the time period, the more other factors (inflation [expectations], productivity growth etc) play a role. All these forces together define the shape of the yield curve. There are four traditional theories trying to explain the underlying economic factors that affect interest rates (the shape of the yield curve specifically).
- Unbiased Expectations Theory (also pure expectations theory): It states that the forward rate is an unbiased predictor of the future spot rate. In its broadest interpretation, it means that bonds of any maturity are perfect substitutes for each other. For example, buying a 5 year bond and holding it for 3 years has the same expected return as buying a 3 year bond or buying a series of 3 one year bonds. This is consistent with risk neutrality as risk premiums do not exist, which is clearly in conflict with the observation that investors are risk averse. There is a refined version called local expectations theory which does not assert that every maturity has the same expected return but states that the expected return for every bond over short periods is the risk free rate.
- Liquidity Preference Theory: Liquidity premiums exist to compensate for added risk when lending long term. This implies that the forward rate provides an estimator for the spot rate that is biased upwards. The name itself is somewhat confusing as it does not related to liquidity in the sense of being easily tradeable. It cannot explain downward sloping yield curves though unless there is an expectation of deflation.
- Segmented Markets Theory: Yields for different maturities are simply a function of supply and demand for funds at every different maturity. Each market is therefore separate and independent from other yields. This is a theory primarily derived from asset / liability management. E.g. a life insurance company (or pension provider) sells long term liabilities (life insurance contracts / pensions) and wants to buy the long end of the bond market to avoid a mismatch of the costs and their liabilities. This theory thus would not imply that rates need to move together.
- Preferred Habitat Theory: It is similar to the segmented markets theory but does not claim yields are determined independently from each other. For example, if expected excess returns from buying short term securities become large enough, life insurance companies and pension providers will be willing to deviate from holding only long-term securities.
QE revisited: In 2007, the FED held zero mortgage backed securities (MBS). In 2013, it held well over USD 1.3 trillion MBS. Prior to QE, the yield was about 5%-6% but declined to less than 2% by end of 2012. One main reason was that the FED essentially reduced the supply of available MBS or private purchases. The increased demand drove down yields. If there is a preferred habitat (or lack of alternatives for example), bidding for MBS drives down yields. Another aspect is prepayment of existing mortgages if new loans would be cheaper.
Modern Term Structure Models: These models provide quantitatively precise descriptions of how interest rates evolve. They are mainly an attempt to capture the statistical properties of interest rates and as such not really an explanation but mainly a means to solve a particular problem (e.g. valuation of complex fixed income instruments and bond derivatives). Therefore, I'll just list them without going much into detail. It is important to note though that the availability of derivatives and hedging instruments will have an impact on yields and spreads as well. For example, credit default swaps (CDS) combined with bonds should yield a close to risk free bond.
Equilibrium Term Structure models: seek to describe the dynamics of the term structure using economic variables assumed to affect interest rates (e.g. a deterministic drift term and some functional form for interest rate volatility). The best-known models are the Cox-Ingersoll-Ross (CIR) Model and the Vasicek Model. As an interesting side remark, setting beta in the famous SABR model to 1/2 results in CIR dynamics. Both CIR and Vasicek have the same drift term and tend towards mean reversion in the short rate r and the stochastic vol term follows a random normal with mean zero and standard deviation 1. One major difference is that in Vasicek it is theoretically possible for interest rates to become zero, which was ironically seen as a major disadvantage for some time. Also, the estimated yield curve may not match an observed yield curve. Therefore, arbitrage free models were derived.
Arbitrage Free Models: E.g. the Ho-Lee Model which is like the Vasicek model but allows the parameters to vary deterministically with time to generate prices that match the market prices.