The differences between breeds have been developed through a combination of four evolutionary forces: genetic drift, migration, selection and mutation.
Genetic drift is a term for the random fluctuations of allele frequencies due to random sampling processes involved when genes are passed from parent to offspring, and it is one of the phenomena linked to inbreeding. It plays a larger role in smaller populations. Over time genetic drift will lead to increasing genetic differences between two breeds drawn from the same population and subsequently maintained in isolation.
The migration of individuals moving from one breed to another lessens the genetic differences that exist between the breeds, and increases the variation within the recipient breed which acts against inbreeding.
If selection occurs, carriers of favourable alleles have a selective advantage in the next generation. In livestock, selection can be both artificial and natural. Artificial selection may lead to convergence or divergence between breeds depending on the selection goals used in each breed. Natural selection will have played an important role in improving adaptive fitness for particular breeds kept over many generations in environments with specific challenges e.g. periodic droughts.
In general, mutation in the genome increases the genetic differentiation between breeds and creates genetic diversity. However, mutation occurs with a low frequency and, in the absence of selection, the influence of mutation becomes measurable only over a relatively large number of generations. However at some point in the past, mutation has been responsible for creating the polymorphisms that lie at the heart of all genetic diversity.