Zoloft etc. (sertraline) is a selective serotonin reuptake inhibitor (SSRI) antidepressant. Sertraline works by increasing levels of serotonin, one of the neurotransmitter chemicals that carries messages between brain nerve cells.
Neurotransmitters are secreted by one cell and picked up by receptor proteins on the surface of another cell. Once the message has been delivered, a neurotransmitter is either destroyed or absorbed into the cell that made it. This process is known as re-uptake. When re-uptake is inhibited, the effect of the neurotransmitter (in this case serotonin) is amplified.
Neurotransmitters like serotonin are involved in the regulation of pain, pleasure, anxiety, panic, arousal, and sleep behavior (the sleep-wake cycle).