Escape reflex

[1] It is a simple reflectory reaction in response to stimuli indicative of danger, that initiates an escape motion of an animal.

The nerve fibers travel up to the spinal cord where they cross the midline, go to the left side, and synapse on an interneuron.

When the afferent nerve fibers synapse on the interneuron, they can either inhibit or excite an alpha motor neuron on the muscles on side contralateral to the stimulus.

[5] Escape reflex arcs have a high survival value enabling organisms to take rapid action to avoid potential danger or physical damage.

[7] These factors cause delays or weakness in the reflex, and they can even develop into learned helplessness, which has been found in animals and Drosophila flies.

The above diagram is a simplified version showing that a cockroach will not venture towards a dangerous stimulus. Due to the escape reflex, the cockroach will take an alternative route once it has sensed the stimulus. [ 3 ]
As the stimulus on the left side enters the ear, the signal is processed and inhibits the muscles on the same side as the stimulus. Muscles on the opposite side remaining working, which allows the creature to quickly pull away from the stimulus if it is threatening. This depiction is a simplified version and does not contain all accurate structures involved. [ 4 ]