Role of phenotypic plasticity and population differentiation in adaptation to novel environmental conditions