The first thing to understand is that banks lend to each other as part of the normal functioning of the banking system. Banks transfer money between themselves based on customer transactions, and banks that end up losing flows typically borrow from banks with the excess. They do this on an overnight basis, since the flows can reverse the next day.
Central banks have a policy rate, the details of which depend upon the country. Typically, it undertakes actions to keep the private sector interbank lending rate near this target. It does not necessarily have to lend money to banks itself to do this.
So is the official cash rate set by the central bank (or equivalent central bank rates overseas) the rate which banks lend to one another, or is it the rate the central bank lends to retail banks?
As explained above, the central bank announces a target for the overnight rate between banks. There are a number of ways to achieve this objective (repos, outright purchases of bonds, borrowing/lending, discounting bank assets). If you wish, you can search for those terms individually, or consult central bank websites for primers.
And how does this ultimately affect normal people borrowing from
retail banks?
Lenders compare the risks of potential borrowers, and charge a yield premium - a spread - for riskier borrowers. Lending to the central government is normally the least risky form of lending, and then lending to other banks. The implication is that all other forms of lending are riskier, and so they borrow from banks at a positive spread to the interbank rate. This means that the interbank rate is the benchmark for other borrowers, and explains why central banks guide the interbank rate.
(In the midst of a crisis, almost all forms of lending can be viewed as risky, and lending rates can be quite unstable. Central banks need to take actions to eliminate these credit stresses.)