Each year, malaria parasites cause more than 500 million infections and 0.5-3 million deaths worldwide, mostly among children under five living in sub-Saharan Africa. In contrast with several viral and bacterial pathogens, which elicit long-lived immunity after a primary infection, these parasites require several years of continuous exposure to confer partial, usually non-sterilizing immune protection. One of the main obstacles to the acquisition of antimalarial immunity is the high degree of antigenic diversity in potential target antigens, which enables parasites to evade immune responses elicited by past exposure to variant forms of the same antigen. Allelic polymorphism, the existence of genetically stable alternative forms of antigen-coding genes, originates from nucleotide replacement mutations and intragenic recombination. In addition, malaria parasites display antigenic variation, whereby a clonal lineage of parasites expresses successively alternate forms of an antigen without changes in genotype. This review focuses on molecular and evolutionary processes that promote allelic polymorphism and antigenic variation in natural malaria parasite populations and their implications for naturally acquired immunity and vaccine development.