Chemicals called neurotransmitters (such as dopamine and serotonin) are released into the synaptic cleft and diffuse across it (down a concentration gradient).
When an electrical impulse arrives at the end of the axon on the presynaptic neurone, chemical messengers called neurotransmitters are released from vesicles.
The neurotransmitters diffuse across the synaptic gap and bind with receptor molecules on the membrane of the second neurone (known as the postsynaptic membrane).
The neurotransmitters are then destroyed or recycled to prevent continued stimulation of the second neurone which would cause repeated impulses to be sent.
Synapses ensure that impulses only travel in one direction, avoiding confusion within the nervous system if impulses were travelling in both directions.
As this is the only part of the nervous system where messages are chemical as opposed to electrical, it is the only place where drugs can act to affect the nervous system.