First and foremost when dealing with a question like this we need to define and understand the key concept involved, and in this instanct it is speciation: the divergence of two distinct lineages from one prior species, that results in a new species over the course of evolution. This question in particular is focusing on the genetic aspects of speciation - not how geography has caused two species to split, but how the genetic content has altered as a result. It requires an understanding that evolution requires that allele frequencies change with time in populations, and this is achieved via genetic mechanisms.
The most prominent such mechanism is mutation, a random change in the genetic composition of an organism due to changes in the DNA base sequence. The mutation can cause an allele that has a fitness benefit different from the original. A second possibility is gene flow between populations: the movement of alleles into, or out of, a population as a result of immigration or emigration. It is also important to comment on the genetic consequences of natural selection, i.e. the fitness benefits which organisms have as a result of more adaptive alleles, will ultimately result in a change in allele distribution across the gene pool of the population.