I have no knowledge of Australia or the uk mortgage markets but in America mortgages get packaged up in securities and sold to investors in the market or big agencies/government programs. Most banks don’t hold mortgages on their books for long before selling them off. Some banks retain servicing but don’t hold the debt on their books. It’s all very complicated and feels like a shell game but mortgage markets have only blown up once in memory whereas I’ve stopped counting recessions.
https://en.m.wikipedia.org/wiki/Mortgage-backed_security
https://www.axios.com/2023/04/08/banks-retreating-mortgage-m...