It is based on Hebb's postulate on plasticity of synapse, which states that "the neurons that fire together wire together". This causes the synapse to be a long-term potentiation (LTP) or long-term depression (LTD).