Punishment is a type of feedback to simulate the worse thing happening with low cost but with enough stimulation to learn.
Eg a flick of the wrist when a toddler doesn’t listen so that they do listen when it’s a car they are about to run in front of.