Fluid flow in porous media drives the transport, mixing, and reaction of molecules, particles, and microorganisms across a wide spectrum of natural and industrial processes. Current macroscopic models that average pore-scale fluctuations into an effective dispersion coefficient have shown significant limitations in the prediction of many important chemical and biological processes. Yet, it is unclear how three-dimensional flow in porous structures govern the microscale chemical gradients controlling these processes. Here, we obtain high-resolution experimental images of microscale mixing patterns in three-dimensional porous media and uncover an unexpected and general mixing mechanism that strongly enhances concentration gradients at pore-scale. Our experiments reveal that systematic stretching and folding of fluid elements are produced in the pore space by grain contacts, through a mechanism that leads to efficient microscale chaotic mixing. These insights form the basis for a general kinematic model linking chaotic-mixing rates in the fluid phase to the generic structural properties of granular matter. The model successfully predicts the resulting enhancement of pore-scale chemical gradients, which appear to be orders of magnitude larger than predicted by dispersive approaches. These findings offer perspectives for predicting and controlling the vast diversity of reactive transport processes in natural and synthetic porous materials, beyond the current dispersion paradigm.