Part of the Bank of Canada's mandate is to regulate interest rates.
Interest rates are essentially based on supply and demand of borrowing. I'm not talking about consumer lending, but rather institutionalized lending. The premise is simple. If an institution has a need for 'overnight' borrowing, they need a short term loan to meet debt obligations, they will 'shop' for the best possible interest rate with other institutional traders. If there is too much currency available to be borrowed rates will be lower, since everyone who has a surplus wants to loan their money out for the profit they realize, even on a single day basis. As a large institution if I can loan you money for 1 day, let's say you need $500m then the interest in 1 day becomes a little more significant, and there's incentive to make that loan.
If the rates fall below or raises above what the Bank of Canada calls 'The operating band' essentially .25-.50 basis points lower or higher than BoC prime rate. If interest rates are too HIGH, if money is in short supply, and the institutional investors are asking for too much interest on their loans, the BoC will issue what's known as an SPRA (Special Purchase and Resale Agreement) to the borrowers so pressure the interest rates down. They will offer the SPRA at the HIGH level of the operating band, so slightly higher than prime.
If interest rates are too LOW, money is in high supply, and institutional investors are shopping prices down below the lowest level of the operating band, below what lenders are wanting to earn for their loans.. the BoC will issue an SRA (Sale and Repurchase Agreement) and BORROW money at the lowest level of the operating band forcing institutions that need to borrow to offer at least that interest rate to obtain the money they need.
To give you a rough idea, worldwide it is estimated overnight institutional lending accounts for over $100billion in financial transactions, daily.
In short, Governments borrow and lend money to set and control current interest rates.