Anyone with exposure to the professional pilot training scene (as I've had, as a CPL/IR, though I don't fly commercially) will know that cheating is endemic among 3rd World candidates.
They do their class assignments together in the hotel. I've seen it. If they can, they write the answers on the back of airway charts, etc.
The exam system encourages cheating because the QB (question bank) has been public for about 20 years, so everybody learns by memorising the QB. You more or less have to, because most of it is bull**t and irrelevant. Most regard it as a joke.
For customers willing to go a bit further, there has been complicity among certain schools over the years. One, in Spain, was selling the JAA ATPL exam passes (14 exams) for €10k... reportedly. That saves a lot of revision.
So you may ask: how do airline pilots manage to not crash all the time? Because they sit in the RHS (right hand seat; first officer) for hundreds of hours, with a training captain in the LHS who won't let them screw up. Well, that's what you have in most airlines...
The written exams are mostly a barrier to make sure that only really keen people reach the cockpit. They also keep the schools in business, where the candidate dumps 80-100k, for a course (a CPL/IR finished in a piston twin; yes a piston twin is barely relevant to a big twin jet but that's another Q you aren't supposed to ask) which you could do DIY for 30-35k. There is a lot of money in pilot training, both in the 14 exams and in the flight training, and a lot of vested interests everywhere.
The real reasons why 3rd World airlines are less safe - even if they have the same brand new Boeing or Airbus planes - are to do with the process and culture. There is massive corruption. Who you know matters. Corners are cut. Loss of face is unacceptable, so mistakes are covered up, instead of learnt from. Maintenance is often poor, which is OK until enough things go wrong together and then it bites you. It is no coincidence that the 737 MAX got crashed only by these airlines; outfits like Ryanair never got anywhere near close enough to stalling the plane to discover its dodgy stall protection software.
ELP (English language proficiency) is often marginal, too. Lots of the candidates can barely understand the material. This is a serious enough issue in Europe, actually. Loads of French electronics graduates cannot read English (well, American, say Maxim) data sheets. So French designed products of all kinds use some amazingly obscure components - because the data sheets exist in French.
EASA has suspended Pakistan airlines flying into Europe, along with many others.
https://www.euroga.org/forums/hangar-talk/11981-are-big-jets-really-easy-to-fly-or-is-the-atpl-theory-just-garbage/post/250881#250881