Forests are among the most important repositories of terrestrial biodiversity and provide a broad range of ecosystem services. During millennia, forests have changed, adapted and evolved under changing conditions. However, in the present century, forests are facing environmental changes at rates with no precedents. A major concern is the risk of declining forest genetic diversity, since genetic variation as the raw material underpinning adaptation is key in maintaining the resilience of forest ecosystems against environmental changes. Understanding the different processes responsible for developing and maintaining the genetic diversity of tree species is essential to better predict tree responses under new conditions. Therefore, this thesis aimed to determine how different forces interact to shape and maintain within and among population genetic diversity of Scots pine and what the implications are for conservation and management under forthcoming environmental conditions. From local to continental scales, I followed a multilevel approach, and found that (i) historic climate changes and geographical barriers have played an important role in shaping the extent and spatial distribution of current genetic diversity of Scots pine. Despite contemporary habitat reduction and fragmentation we found that (ii) high levels of neutral genetic diversity remain in the Scottish populations of Scots pine, with gene flow and specifically wind-driven gene flow dominating over genetic drift and preventing differentiation among the Scottish populations. However, (iii) considerable impacts in the spatial distribution of genetic variation have occurred as a consequence of intensive historical forest management practices. Furthermore, we found that (iv) substantial levels of adaptive genetic variation are present in the Scottish populations of Scots pine, likely a result of selective processes resulting from the different environments they live in, with highly heritable traits, although similar capacity for response through phenotypic plasticity to warming. The results of this thesis help to further disentangle the forces maintaining genetic diversity in one of most widespread conifers in the world, and improving predictions of likely range shifts and adaptation of the species in response to contemporary changes. The thesis provides some recommendations to conservation and management practices.