Lumping those together makes it sound like "highly educated" is due to chance, but primarily it depends on how much the people decide to value education.Life is good when you have a solid chunk of oil and a small highly educated population.
Other Scandinavian countries without oil are just as highly educated. Sweden and Finland already had near-full literacy two centuries ago.