Whenever children are spanked, it is most commonly disciplinary spanking. However, the opposite is not necessarily true: although much of today's adult spanking is erotic spanking, some adults practice consensual or nonconsensual spanking for punishment as well. Spanking of a penitent (one who confesses and asks to be punished) typically is disciplinary spanking, e.g. designed to bring tears to the spankee's eyes.
In the case of nonconsensual punishment, this practice is illegal in some countries and called "wife battering" or domestic violence. In the case of consensual punishment, it is called domestic discipline and legal everywhere.