A rat is placed inside a box, in which it receives electric shocks. Every time the rat (accidentally) pressed a lever within the box the electric shock would stop. Eventually, the rat learnt that if it continued to perform the behaviour (pressing the lever) the electric shock would be removed.