They did it by not following the recommendations for development of the IMF and the World Bank (that are, basically, American institutions).
Look at this, for example (GP mentioned both poverty and education so I was curious and went to look at the second of the two): https://ourworldindata.org/grapher/primary-enrollment-select... Niger is far behind Hungary and the UK, but Niger's curve doesn't look like failure to me, it looks like a success starting later than the others on the graph, and all the more impressive considering Niger's population growth. Faster growth than Hungary despite despite population growth.
I'm perplex. There's a general argument, GP's is an example, that goes a little like this: "(something) may be the best ever, but it's (a failure/not good enough/...) and it's clear that (someone else/another approach/...) will achieve much better results". I don't see that it's clear not at all. But I don't see that GP is stupid either. So... I'm perplex. What is it I'm missing about GP's comment?
you say: 'will achieve much better results". I don't see that it's clear not at all.'
If you check the policies promoted from the international institutions (and those are, in essence, a product of the USA) they are the opposite of what the developed countries did to be developed. Check Ha-Joon Chang(1) work for a study of this.
Of course, the issue is very complex, but a case could be made, that the small development we see in those countries is despite the American order, instead of because of it.
That's before even talking about all the invasions and coups in countries that didn't follow the interest of USA capital.
A country is not developed by opening its markets, don't protecting its industry and "specializing" in exporting their natural resources, but by stability and investment.
So, from the point of view of small countries, what is the problem with changing masters?
And China is, for now, really investing. For instance, check your example, Niger: https://www.businessinsider.com/niger-oil-and-chinese-invest...
Of course China is just following their interest, but so do the Americans.