Mathematical simulation of the evolution of polymorphic legume-rhizobium symbiosis showed that co-evolution of the partners for an improved ecological efficiency of symbiosis is greatly stimulated when low-active N2-fixing and non-N2-fixing strains of nodule bacteria are prohibited from colonizing nodules. The results of analysis of the model were collated with the comparative morphology of the infection process in various legumes, and its was assumed that mechanisms controlling bacterial reproduction in nodules arose in early evolution of symbiosis in primitive legumes owing to a transition from mixed to clonal infection. The development of such mechanisms was associated with adaptively valuable macroevolutionary transformations of symbiosis and directed its microevolution towards a parallel increase in the specificity and efficiency of mutualism. The increase was due to a reorganization of selective processes in endosymbiotic bacterial populations, which was based on changes in their genetic and spatial structures and optimized metabolic feedbacks between the partners (preferential allocation of photosynthesis products to the most active N2-fixing strains).