When those countries were ruled by outsiders, the people who ran them weren't picking capable locals to have power, they were picking capable outsiders to have power. (And that's in the best case.)
The locals were only used for manual labour and filling out conscript armies (overseen by coloniser officers). This creates societies where, for generations, none of the natives have any experience with doing any of the jobs necessary to actually govern a country.