The two genetic mechanisms behind this are the law of dominance and the law of segregation.: [1]
a) Law of Dominance : According to this law, out of the two alleles, only one allele expresses itself in the F1 generation and prevents the expression of the other allele. The allele which expresses itself is called the dominant allele and the other allele which is unable to express ia called as the recessive allele. [1]
b) Law of Segregation : According to this law, two alleles of a gene stay together but during gamete formation, the alleles of a pair segragate from each other such that a gamete receives only one of the two alleles. [1]
Therefore, purple being dominant over white got expressed in the F1 generation. Upon selfing these plants of F1 generation they produced purple as well as white flowers in a 3:1 phentotypic ratio.