The pure rate of interest is determined by the time preferences of everyone in society. Lenders, who have lower time preferences, supply present money to borrowers, who have higher time preferences. The pure rate of interest is at the level that clears the market, i.e., at which the quantity demanded of present money is the same as the quantity supplied.
Arbitrage by lenders keeps the pure rate of interest the same across the time market. If the 2 year corporate bond rate is 5%, then the rate of return on investment in 2 year production processes in the capital structure will also be 5%.
If circumstances differ between two types of loans, then their market rates of interest will differ even if they have the same time preference premium. If the two year corporate bond is AAA at 5% and the two year investment project is riskier, then its interest rate will be above 5%.