The insect ovary is a modular structure, the functional unit of which is the ovariole. Ovariole number is positively correlated with potential reproductive output. Among drosophilids (Insecta: Diptera), ovariole number shows both phenotypic plasticity and substantial interspecific and interpopulational variation. Here we examine the mechanistic connection between phenotypic plasticity and genetically fixed variation in ovariole number within the melanogaster species group. When a laboratory population of Drosophila melanogaster was reared under reduced food conditions, differences in ovariole number were entirely due to alterations in cell differentiation during the wandering stage at the very end of larval development. Cell growth and cell death were not affected. When these same flies were reared under a variety of temperatures, ovariole number differences arose during the latter half of the third (final) larval instar. Cell differentiation was affected, although cell number was not, and ovariole number differences were established before metamorphosis. In contrast, genetically fixed, interspecific and interpopulational variability in ovariole number was caused by alterations in the dynamics of cell differentiation and by cell number differences. Furthermore, the stages affected were different in different species and populations in the melanogaster species group, ranging from the first (D. sechellia) through the middle of the third (D. simulans and D. mauritiana) larval stage. Therefore, the mechanistic bases for plasticity-based variability are largely distinct from the mechanistic bases for interspecific and interpopulational variability. Our results suggest that phenotypic plasticity indicates evolutionary flexibility in underlying ontogenetic processes.