How a country becomes a Kakiscracy is usually step by step. Countries don’t go from whatever they were to the bottom of the barrel.
In my country, it began with Independence.
Up until 1962, the United Kingdom appointed senior civil servants. The persons were qualified, capable, etc.
At independence, most remained in their posts until their junior was capable. The junior was just as competent.
The junior would usually last perhaps ten years before retirement, and the post filled by another junior. Some had spent a portion of time under the Brits, some had not. Those who had came into the office with a certain competence were difficult to corrupt. Those who began their career under local seniors had some competence, but other were soon puppets of the government in power.
In 1980 many civil servants were gotten rid of by the Government.
It was not difficult. Merge two Ministries. Positions are now redundant. Get rid of those who aren’t puppets. Once the independent competent members are removed, split the Ministry into two or three different agencies, and pile in political poodles.
When that Party came out of power in 1989 the damage was already done. As many were political poodles there was a level of sabotage.
By 1992, thirty years after Independence, few were in place who had worked under the British, and those were due for retirement, meaning they could be replaced on a strictly personal basis.