In the natural world, individual organisms can adapt as their environment changes. In most in silico evolution, however, individual organisms tend to consist of rigid solutions, with all adaptation occurring at the population level. If we are to use artificial evolving systems as a tool in understanding biology or in engineering robust and intelligent systems, however, they should be able to generate solutions with fitness-enhancing phenotypic plasticity. Here we use Avida, an established digital evolution system, to investigate the selective pressures that produce phenotypic plasticity. We witness two different types of fitness-enhancing plasticity evolve: static- execution-flow plasticity, in which the same sequence of actions produces different results depending on the environment, and dynamic-execution-flow plasticity, where organisms choose their actions based on their environment. We demonstrate that the type of plasticity that evolves depends on the environmental challenge the population faces. Finally, we compare our results to similar ones found in vastly different systems, which suggest that this phenomenon is a general feature of evolution