Within a cosmological hydrodynamical simulation, we form a disc galaxy with subcomponents which can be assigned to a thin stellar disc, thick disc and a low-mass stellar halo via a chemical decomposition. The thin- and thick-disc populations so selected are distinct in their ages, kinematics and metallicities. Thin-disc stars are young (<6.6 Gyr), possess low velocity dispersion (ωU, V, W =41, 31, 25 km s-1), high [Fe/H] and low [O/Fe]. Conversely, the thick-disc stars are old (6.6 < age < 9.8 Gyr), lag the thin disc by ~21 km s-1, possess higher velocity dispersion (sU, V, W = 49, 44, 35 km s-1) and have relatively low [Fe/H] and high [O/Fe]. The halo component comprises less than 4 per cent of stars in the 'solar annulus' of the simulation, has low metallicity, a velocity ellipsoid defined by sU, V, W = 62, 46, 45 km s-1 and is formed primarily in situ during an early merger epoch. Gas-rich mergers during this epoch play a major role in fuelling the formation of the old-disc stars (the thick disc). We demonstrate that this is consistent with studies which show that cold accretion is the main source of a disc galaxy's baryons. Our simulation initially forms a relatively short (scalelength ~1.7 kpc at z = 1) and kinematically hot disc, primarily from gas accreted during the galaxy's merger epoch. Far from being a competing formation scenario, we show that migration is crucial for reconciling the short, hot, discs which form at high redshift in cold dark matter, with the properties of the thick disc at z = 0. The thick disc, as defined by its abundances, maintains its relatively short scalelength at z = 0 (2.31 kpc) compared with the total disc scalelength of 2.73 kpc. The inside-out nature of disc growth is imprinted in the evolution of abundances such that the metal-poor a-young population has a larger scalelength (4.07 kpc) than the more chemically evolved metal-rich a-young population (2.74 kpc).