Discipline can mean a code of behavior to which a person adheres (as in self-discipline); it can mean an externally enforced system of rules and behavior (as in naval discipline); it can mean the standard of adherance to such a code (as in highly disciplined); it can refer to punishments through which behavior is enforced, or the act of imposing such punishments. But discipline also covers rewarding positive behavior as well. The original English form of the word is in a Middle-english word meaning simply whipping, but that derives from a Latin word meaning "instruction given to a disciple".
The verb to discipline means:
In a BDSM context, "discipline" most often refers to the punishments imposed by the dominant on the submissive for breaking a rule, or to the overall regimen of control enforced by a D/S relationship.
In consensual spanking, discipline typically refers to the spanking act, which means spankee and spanker are playing with the ideas of rules and punishment. Typically, the spankee may break a "rule", knowing this will cause the spanker to initiate a spanking session. While discipline can have many contexts, discipline in a family setting is a common one. In a household, punishment and spanking is called domestic discipline.