In the short term irrationality can and does prevail in both markets and democracy. In the long term, the best product and ideas always win. This is why both democracy and markets are durable.
Paraphrased differently, this is the weak-form of the efficient market hypothesis. All decentralized processes have some level of gravitational pull toward efficiency. They're not perfectly efficient, obviously. But they trend in that direction on long time scales, unlike the alternative which is being anchored only to the whims of the fickle elite.