We study the geometry of \mathcal D - bundles —locally projective \mathcal D -modules—on algebraic curves, and apply them to the study of integrable hierarchies, specifically the multicomponent Kadomtsev-Petviashvili (KP) and spin Calogero-Moser (CM) hierarchies. We show that KP hierarchies have a geometric description as flows on moduli spaces of \mathcal D -bundles; in particular, we prove that the local structure of \mathcal D -bundles is captured by the full Sato Grassmannian. The rational, trigonometric, and elliptic solutions of KP are therefore captured by \mathcal D -bundles on cubic curves E , that is, irreducible (smooth, nodal, or cuspidal) curves of arithmetic genus 1 . We develop a Fourier-Mukai transform describing \mathcal D -modules on cubic curves E in terms of (complexes of) sheaves on a twisted cotangent bundle {E^{\natural}} over E . We then apply this transform to classify \mathcal D -bundles on cubic curves, identifying their moduli spaces with phase spaces of general CM particle systems (realized through the geometry of spectral curves in {E^{\natural}} ). Moreover, it is immediate from the geometric construction that the flows of the KP and CM hierarchies are thereby identified and that the poles of the KP solutions are identified with the positions of the CM particles. This provides a geometric explanation of a much-explored, puzzling phenomenon of the theory of integrable systems: the poles of meromorphic solutions to KP soliton equations move according to CM particle systems.