In addition to factors listed by tdracer #26 let’s give credit to the International Civil Aviation Organization. In recent years ICAO’s mentoring and audits have helped ensure that its Standards and Recommended Practices are implemented worldwide. ICAO does not check individual airlines, just that National Aviation Authorities do their job properly.
ICAO has a neat tool to compare competencies of different Authorities;
https://www.icao.int/safety/pages/usoap-results.aspx. For instance China has overcome its poor safety record to rank alongside Australia, but not as highly as Canada. Singapore is brilliant.