Star Wars: Why droids were made to feel pain : r/FanTheories

In Return of the Jedi, R2 and C3PO pass by a droid torture chamber, where they see droids being burned by hot irons and screaming (RIP Gonk). C3PO screams when he gets shot by a blaster, and he shows repeated fear at the thought of any kind of physical harm or pain.
Compare that to Attack of the Clones, when he literally was decapitated, and had his head soldered onto a new body, cut off, then soldered onto a new one with only a few puns thrown in, and no sign of pain. The entire droid army advances even after being shot, and shows no real fear or reaction to pain. A magnaguard literally is half crushed, and still goes for it's staff.
Droids after the Clone Wars had chips added to make them feel pain, to avoid them being used as soldiers again.
The Clone Wars likely terrified the galaxy. Sure, highly trained clones could take down droids easily, but for your average civilian, even a basic B-1 droid could be a deadly threat. The Mandalorian shows us a brief clip of Separtists attacking a village that emphasizes how brutal those droids could be. Imagine an entire army that feels no pain, no fear, no exhaustion. Adding those chips was people's way of preventing any future war, or a robot revolution.