When something goes haywire, it's out of control or completely chaotic. You'll sense that things have gone haywire at a birthday party if suddenly the young guests are having a crazed water gun fight indoors.
A riot is an extreme example of things going haywire, when people get angry enough about something that they ignore rules and laws, breaking windows and setting things on fire. A less serious case of things gone haywire could be a flock of chickens escaping an enclosure, running loose in your vegetable garden. The literal, and original, meaning of haywire is "wire used to bind hay." The wire's "springy unpredictability" led to today's common definition.