The storage effect, a mechanism that promotes species coexistence in temporally variable environments, poses a dilemma to evolutionary ecologists. Ecological studies have demonstrated its importance in natural communities, but evolutionary models have predicted that selection either impedes coexistence or diminishes the storage effect if there is coexistence. Here, we develop a lottery model of competition in which two species experience a trade-off in competitive ability between two types of years. We use an adaptive evolution framework to determine conditions favoring the evolution of the storage effect. Storage evolves via divergence of relative performance in the two environments under a wide range of biologically realistic conditions. It evolves between two initially identical species (or lineages) when the trade-off in performance is strong enough. It evolves for species having different initial trade-offs for both weak and strong trade-offs. Our simple 2-species-2-environment scenario can be extended to multiple species and environmental conditions. Results indicate that the storage effect should evolve in a broad range of situations that involve a trade-off in competitive ability among years, and are consistent with empirical observations. The findings show that storage can evolve in a manner and under conditions similar to other types of resource partitioning.