Voltage-controlled spintronic devices depend on thin films whose local structure supports reliable magnetic control. Microscopy, spectroscopy and simulations reveal how grain boundaries, dopant sites and oxygen distribution influence candidate materials.