Spanking is the alternative when a chld can not reason or does not have the experience to avoid serious harm.
Once a child has the reasoning power that things like a hot stove will burn them, spanking has no valid merit.
One can keep the threat of spanking alive after it has no merit for only a short time.