Several reasons for the election of Trump.
Right Wing politicians are on the rise across the US and Europe. There’s disenchantment and widening fragmentation of the political landscape as a significant portion of the population did not benefit from globalization (in part due to education). The Liberal Left has been in power for decades, political power is now swinging to the Right.
US educational system is also failing. It has some of the best universities, but it’s basic educational system is failing. Democracy comes with great responsibilities; your citizens need to be educated enough to make the right decisions.
It doesn’t work in places like Afghanistan or India or Middle East because of corruption, again due to poverty, and poverty and education go hand in hand in most cases. Without them democracy is just mob rule.