Alternatively, this is what happened when Reverend Spears "New Motive Power" (Google it, it's amazing) actually worked, and his electric Messiah is the secret mastermind behind everything. Bonus points if the "Society of Electrizers" (another part of Spear's fascinating religious beliefs - essentially, the Electrizers are undead apostles of human technological accomplishment, including Benjamin Franklin) are either secretly behind the robot rebellion or are leading the movement to suppress it.
tl;dr, it's all because of smart people ghosts creating the Patriots in 19th-century America using magnets and a dining room table.