Genomic imprinting, the allele-specific expression of a gene dependent on its parent-of-origin, has independently evolved in flowering plants and mammals. In mammals and flowering plants, imprinting occurs in the embryo as well as in embryo-nourishing tissues, the placenta and the endosperm, respectively, and it has been suggested that imprinted genes control the nutrient flow from the mother to the offspring ('kinship theory'). Alternatively, imprinting might have evolved as a by-product of a defense mechanism destined to control transposon activity in gametes ('defense hypothesis'). Recent studies provide substantial evidence for the 'defense hypothesis' by showing that imprinted genes in plants are located in the vicinity of transposon or repeat sequences, suggesting that the insertion of transposon or repeat sequences was a prerequisite for imprinting evolution. Transposons or repeat sequences are silenced by DNA methylation, causing silencing of neighboring genes in vegetative tissues. However, because of genome-wide DNA demethylation in the central cell, genes located in the vicinity of transposon or repeat sequences will be active in the central cell and the maternal alleles will remain unmethylated and active in the descendent endosperm, assuming an imprinted expression. Consequently, many imprinted genes are likely to have an endosperm-restricted function, or, alternatively, they have no functional role in the endosperm and are on the trajectory to convert to pseudogenes. Thus, the 'defense hypothesis' as well as 'kinship theory' together can explain the origin of genomic imprinting; whereas the first hypothesis explains how imprinting originates, the latter explains how imprinting is manifested and maintained.