Rewiring is about changing where one end of a wire leads to.
Rewiring works by people cutting the wires and leading them somewhere else.
https://www.hgtv.com/design/decorating/furniture-and-accessories/how-to-rewire-a-lamp
https://www.youtube.com/watch?v=cNcUst55t5s