Duplication is the production of a second copy of a particular sequence of DNA in the same genome. The duplicate sequence can appear next to the original or be copied elsewhere into the genome. Duplication is the most likely mechanism for the existence of gene clusters.
Duplications probably arise by 'mistakes' in recombination through a process called unequal crossing-over. This is when two chromosomes fail to exchange equal lengths of DNA: one receives more than the other. A misalignment happens, such that if there were initially two copies of a gene on each strand, then after crossing-over there are three on one strand and one on the other.
Once a duplication has originated in a single copy, it could spread through the population by drift or selection. The two genes could retain the same sequence if selection favored multiple copies of the gene. Or they could diverge to form a gene family (like the human globins). Or, if only one of the copies of the gene is needed, the other might be switched off or decay by mutation and drift.