If you want more in-depth analysis, I recommend the following:
https://www.unz.com/pescobar/steppe-on-fire-kazakhstans-color-revolution/ - Pepe Escobar on the causes and progression
http://thesaker.is/who-lost-kazakhstan-and-to-whom/ - Saker on the aftermath and geopolitical implications
Most of what I'm writing here is a summary of the above and other sources. I'll try and keep it short so no TLDR.
Timeline1. The initial cause of the unrest was that the government had been subsidising fuel costs and discontinued the subsidies because they were becoming too expensive. After the first waves of riots, the government caved in and reinstated (actually increased) the subsidies, but the riots continued with new demands to ban certain politicians and ex-politicians from participating in the government, to subsidise food and medical prices and other typically-socialist policies. Many of the demands were fundamentally impossible, indicating that the major groups demanding them were interested in revolution or disposal of the government rather than reform.
2. Armed groups activated across the country. It's currently popular to compare the coup/'colour revolution' attempt to what happened in the Ukraine in 2014, but Khazakhstan experienced it on a much larger scale. Whereas in the Ukraine violence was mostly contained in Kiev and the greater East (though there were other significant incidents such as the Odessa Trade House Fire), Khazakhstan saw armed uprisings across the country, with most estimates sitting at around 20,000 armed rebels.
3. It quickly became obvious that Kazakh security forces were going to have serious trouble - they had to differentiate between rioters and armed units to avoid a political disaster, they were stretched thin having to deal with disruptions across the country, and dropping morale would lead to desertion, like what happened in Syria and Libya when it began to feel hopeless. The President called for assistance from the Russian-led CSTO (similar to a regional NATO for the smaller Eurasian states), and overnight, two Russian brigades and several smaller special forces units from Belarus and Armenia were deployed.
4. It's unclear how many rebels have been killed but most estimates are in the thousands. Not only have the foreign forces aided the Kazakh security forces in crushing them, they've effectively hardened the security forces' resolve and destroyed the morale of the rebels, given that they now know they do not have the firepower to win and their sponsors will not aid them militarily.
5. There are massive purges going on in the Kazakh government, with the (current) highest profile arrest being the chief of the Kazakh National Security Committee, Karim Massimov. He's been charged with treason and has been described as a mastermind behind the event, and has both a personal and business history with the Biden family.
AftermathAs per Saker's analysis, the sheer scale of the operation (arming and organising 20,000 fighters) would've required significant time and resources, indicating that this has been in the works for a while. Concurrently, preparing two brigades and units from multiple countries for overnight deployment would also take (at least) weeks, which indicates that the Russians (and given that they warned Erdogan of his impending assassination, likely the Kazakh government) knew it was coming too - they allowed it to happen to demonstrate to the Kazakh government that the west are not friends, regardless of what they say. An attempt to ruin the country in order to create another front for Russia has instead driven them into Russia's 'orbit'.
Will post more later, currently looking into who specifically funded this. The NED (the 'overt' political arm of the CIA) alone has poured 2-3 million into 'political causes' in Kazakhstan over the last few years which means other NGOs aren't far behind, and much more undocumented money and equipment has changed hands. While I don't think Erdogan himself had anything to do with it, a significant chunk of the armed rebels are ethnically Turkish and/or belong to Turkish separatist groups so they likely have some level of support back home.