Black hole and neutron star X-ray binary systems routinely show quasiperiodic oscillations (QPOs) in their X-ray flux. Despite being strong, easily measurable signals, their physical origin has long remained elusive. However, recent observational and theoretical work has greatly improved our understanding. Here, we briefly review the basic phenomenology of the different varieties of QPO in both black hole and neutron star systems before focusing mainly on low frequency QPOs in black hole systems, for which much of the recent progress has been made. We describe the detailed statistical properties of these QPOs and review the physical models proposed in the literature, with particular attention to those based on Lense-Thirring precession. This is a relativistic effect whereby a spinning massive object twists up the surrounding spacetime, inducing nodal precession in inclined orbits. We review the theory describing how an accretion flow reacts to the Lense-Thirring effect, including analytic theory and recent numerical simulations. We then describe recent observational tests that provide very strong evidence that at least a certain type of low frequency QPOs are a geometric effect, and good evidence that they are the result of precession. We discuss the possibility of the spin axis of the compact object being misaligned with the binary rotation axis for a large fraction of X-ray binaries, as is required for QPOs to be driven specifically by Lense-Thirring precession, as well as some outstanding gaps in our understanding and future opportunities provided by X-ray polarimeters and/or high throughput X-ray detectors.