For instance, when a rat is provided with only a platform to rest from swimming and the top of the platform is mildly electrified, the rat will respond in ways that will terminate such aversive stimulus. One way is to jump off into the water away from the platform. The jumping of rat when it gets shocked is an escape behavior, and if every time the rat jumps off the platform when given a mild shock (while resting) is an example of escape conditioning.
An escape conditioning becomes an avoidance conditioning when a cue or a warning signal is given before the aversive stimulus starts. An example of a cue is sounding a tone before electrifying the platform. After one or two trials the rat will respond by jumping off the platform every time it perceives the tone, no longer waiting for the mild shock. Hence, it avoids the aversive stimulus even before it starts.
See also: avoidance conditioning