Of the people, by the shitty
Its roots, of course, go back even further – it’s borrowed from the Greek kakistos, or “worst”, which itself probably comes from the Proto-Indo-European word kakka, meaning “to defecate”.
In other words, as Nancy Friedman wrote at her blog on language in 2016, “you could say that kakistocracy is ‘government by the shitty’.”