Achieving food security requires resilient agricultural systems with improved nutrient-use efficiency, optimized water and nutrient storage in soils, and reduced gaseous emissions. Success relies on understanding coupled nitrogen and carbon metabolism in soils, their associated influences on soil structure and the processes controlling nitrogen transformations at scales relevant to microbial activity. Here we show that the influence of organic matter on arable soil nitrogen transformations can be decoded by integrating metagenomic data with soil structural parameters. Our approach provides a mechanistic explanation of why organic matter is effective in reducing nitrous oxide losses while supporting system resilience. The relationship between organic carbon, soil-connected porosity and flow rates at scales relevant to microbes suggests that important increases in nutrient-use efficiency could be achieved at lower organic carbon stocks than currently envisaged.