in the brain, a synapse may be strengthened if the pre-synaptic spike occurs about 10-20ms before the post-synaptic spike, but weakened if the pre-synaptic spike occurs about 10-20ms after the post-synaptic spike. This is known as spike time dependent plasticity (STDP).
See Memory, Hebbian theoryLong-term potentiation (LTP) and long-term depression (LTD)
9. Bi, G.Q. and M.M. Poo, Synaptic modifications in cultured hippocampal neurons: dependence on spike timing, synaptic strength, and postsynaptic cell type. J Neurosci, 1998. 18(24): p. 10464-72. 10. Markram, H., et al., Regulation of synaptic efficacy by coincidence of postsynaptic APs and EPSPs. Science, 1997. 275(5297): p. 213-5.
http://www.scholarpedia.org/article/Spike-timing-dependent_plasticity