Local adaptation experiments are widely used to quantify the levels of adaptation within a heterogeneous environment. However, theoretical studies generally focus on the probability of fixation of alleles or the mean fitness of populations, rather than local adaptation as it is commonly measured experimentally or in field studies. Here, we develop mathematical models and use them to generate analytical predictions for the level of local adaptation as a function of selection, migration and genetic drift. First, we contrast mean fitness and local adaptation measures and show that the latter can be expressed in a simple and general way as a function of the spatial covariance between population mean phenotype and local environmental conditions. Second, we develop several approximations of a population genetics model to show that the system exhibits different behaviours depending on the rate of migration. The main insights are the following: with intermediate migration, both genetic drift and migration decrease local adaptation; with low migration, drift decreases local adaptation but migration speeds up adaptation; with high migration, genetic drift has no effect on local adaptation. Third, we extend this analysis to cases where the trait under selection is continuous using classical quantitative genetics theory. Finally, we discuss these results in the light of recent experimental work on local adaptation.