Typically, the conventional wisdom is that "corruption is the mother of incompetence". The argument goes like the following: If there was no corruption, no incompetent judges would be hired, no incompetent civil servants would be hired or promoted, there would be no incompetent NAB, there would be no incompetent MNAs and MPAs and there would be no incompetent Ministers.
Thanks to the dictatorships, they had used the corruption to prolong their rule and survive. Zia ul Haq introduced non-party-based elections to bring the business mafia into the politics and unethical business mafia generated all the mess to engineer incompetence in all areas so their illegal wealth can grow and they never get caught by any system: Judiciary, law enforcement etc. The business mafia ensured incompetent people get hired at all levels to support their illegal actions. Thanks to Zia ul Haque and dictatorship.