Rating agencies grade the mortgage bonds, covered bonds, lenders, mortgage insurers and servicers that the market funds, and their criteria decide how much credit enhancement a private mortgage securitization needs.
Credit rating agencies are one player in the mortgage lending industry, and an industry of their own, with their own suppliers, customers, software, regulators, and money flows. This full map is on the roadmap.
Meanwhile: how credit rating agencies fit into mortgage lending