To be fair, I think about this five times before breakfast:
Humans develop AI to perform economic functions, eventually there is an “AI rights” movement and a separate AI nation is founded. It gets into an economic war with humanity, which turns hot. Humans strike first with nuclear weapons, but the AI nation builds dedicated bio- and robo-weapons and wipes out most of humanity, apart from those who are bred in pods like farm animals and plugged into a simulation for eternity without their consent.
deleted by creator
To be fair, I think about this five times before breakfast: