Thousands of years before the events of Foundation, a war between humans and robots began, with the robots growing resentful of the way they were treated by humans. The First Law of Robotics – a robot should never hurt a human – was broken, and a deadly conflict began. https://screenrant.com/foundation-lady-demerzel-robot-backst...
If we're citing sci-fi (but there's no robot war in Asimov's foundation iirc, the apple screenwriters made it up) surely you want to cite the Butlerian Jihad from Dune!
There isn't in the early Foundation novels, but Azimov spent much of the later part of his career combining/retconning all of his work into a single universe - "Robots and Empire" links the foundation series to the robot series, and the subsequent foundation novels all reference the connection