Gregor Mendel's law of segregation has four parts. First, it defines an allele. Second, it states that organisms inherit one allele from each parent. Third, it states that gametes only carry one allele for each trait. Fourth, it defines the difference between dominant and recessive genes.
The law of segregation is commonly known also as Mendel's First Law and this is the idea that every inheritable trait or gene as we now call them is controlled by a pair of factors or alleles and those pairs of alleles, when you make gametes separate from each other so that for example if you have a dominant version of allele and a recessive version of allele, one of your gametes will be containing the dominant one, the other one will contain the recessive one. And this is caused by the separation of homologous chromosomes that is seen during the process of gamete formation called meiosis.
Now as I just mentioned there's dominant versions of these alleles and recessive versions of those alleles. And this is one of the things that Mendel first figured out when he came up with his first law. And the difference is that dominant alleles will show their effects even if in combination with a different kind of allele. Whereas the recessive alleles only show their traits when paired up in an individual with a similar identical allele.
Now let's take a look at this diagram over here and you can just see now how obvous it is how this process comes about. In the process of meoisis, first if you begin with say two chromosomes and you have a gene over here and the same gene on that homologous chromosome, when it undergoes the s stage of the cell cycle and you wind up with pairs of chromatids joined together at the centromere.
Ultimately those pairs of homologous chromosomes will pair up in the midline and then separate during the process known as meiosis 1. Then in the second stage of meiosis, meiosis 2, you wind up with the separated chromosomes. So if this had a dominant version of allele and this had the recessive version of allele, we wind up with gametes that only contain recessives or only contain dominant alleles. They've been segregated hence the term law of segregation.