Tested on macOS 12.5 Use at own risk
Run this command to set caps lock keyboard button to the backspace
Note this is not persistent. You will need to do this on each boot or add to your boot procedure/profile.
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x70000002A}]}'
Check current user mappings with:
hidutil property --get "UserKeyMapping"
full credit goes to http://homeowmorphism.com/2017/05/27/Remap-CapsLock-Backspace-Sierra
Want to map to Control or some other key? Have a look at the key mappings listed on the Apple macOS key binding page