While classical conditioning explains how organisms learn to associate stimuli, operant conditioning explains how they learn to associate their own behaviors with consequences. Building on Edward Thorndike's earlier law of effect—the principle that behaviors followed by satisfying consequences are more likely to be repeated—B.F. Skinner formalized this approach and developed the Skinner box, a laboratory apparatus that automates the study of reinforcement and punishment in animals. The fundamental insight of operant conditioning is that behavior is shaped by its consequences: reinforcement increases the likelihood of a behavior, while punishment decreases it.
This framework distinguishes four types of consequences based on whether something is added or removed, and whether the goal is to increase or decrease behavior. Positive reinforcement adds a desirable stimulus after a behavior (such as giving praise to a child who cleaned their room), thereby increasing that behavior. Negative reinforcement removes an aversive stimulus after a behavior (such as fastening a seatbelt to stop an annoying beeping sound), also increasing the behavior. On the reducing side, positive punishment adds an aversive stimulus (like receiving a speeding ticket) to decrease behavior, while negative punishment removes a desirable stimulus (such as taking away a teenager's phone privileges) to decrease behavior. A particularly clever technique for teaching novel behaviors is shaping, in which successive approximations toward a desired behavior are reinforced, allowing even complex actions—such as Skinner's famous teaching of pigeons to play ping-pong—to be built step by step.
Operant conditioning also examines how the timing and predictability of reinforcement influence behavior. Four basic reinforcement schedules form the foundation of this analysis. Fixed-ratio schedules reward after a set number of responses and produce high rates of responding with brief post-reward pauses, much like a factory worker paid per piece. Variable-ratio schedules reward after an unpredictable number of responses and produce the highest and most persistent rates of behavior—an effect that explains the powerful grip of gambling. Fixed-interval schedules reward the first response after a set time period, creating a characteristic "scalloped" pattern of slow responding that accelerates as the interval ends. Variable-interval schedules reward after unpredictable time periods and produce slow, steady, extinction-resistant responding. Among these, the variable-ratio schedule is the most resistant to extinction. Beyond formal schedules, the Premack principle offers an additional reinforcement strategy: a more preferred activity can be used to reinforce a less preferred one, often summarized as "Grandma's rule"—you can play video games after you finish your homework.