Energy storage technologies are critical in addressing the global challenge of clean sustainable energy. Major advances in rechargeable batteries for portable electronics, electric vehicles and large-scale grid storage will depend on the discovery and exploitation of new high performance materials, which requires a greater fundamental understanding of their properties on the atomic and nanoscopic scales. This review describes some of the exciting progress being made in this area through use of computer simulation techniques, focusing primarily on positive electrode (cathode) materials for lithium-ion batteries, but also including a timely overview of the growing area of new cathode materials for sodium-ion batteries. In general, two main types of technique have been employed, namely electronic structure methods based on density functional theory, and atomistic potentials-based methods. A major theme of much computational work has been the significant synergy with experimental studies. The scope of contemporary work is highlighted by studies of a broad range of topical materials encompassing layered, spinel and polyanionic framework compounds such as LiCoO2, LiMn2O4 and LiFePO4 respectively. Fundamental features important to cathode performance are examined, including voltage trends, ion diffusion paths and dimensionalities, intrinsic defect chemistry, and surface properties of nanostructures.