I use cosmological hydrodynamical simulations to study the formation and evolution of galaxies similar in mass to the Milky Way. First, I use a set of eight simulations where the haloes have a great variety of merger and formation histories, to investigate how similar or diverse these galaxies are at the present epoch, and how their final properties are related to the particular formation history of the galaxy. I find that rotationally-supported disks are present in 7 of the 8 galaxies at z ∼ 2-3; however, only half of the galaxies have significant disks at z = 0. Both major mergers and the accretion of gas that is misaligned with the preexisting stellar disk contribute to the transfer of material from the disks to the spheroidal components, lowering the disk-to-total ratios during evolution. I also present and discuss recent results of the Aquila Project, which compares the predictions of 13 different numerical codes for the properties of a galaxy in a Λ cold dark matter universe. All simulations use a unique initial condition and are analysed in the exact same way, allowing a fair comparison of results. We find large code-to-code variations in stellar masses, star formation rates, galaxy sizes and morphologies. We also find that the way feedback is implemented is the main cause of the differences, although some differences might also result from the use of different numerical technique. Our results show that state-of-the-art simulations cannot yet uniquely predict the properties of the baryonic component of a galaxy, even when the assembly history of its host halo is fully specified.