We study the connection between a system of many independent Brownian particles on one hand and the deterministic diffusion equation on the other. For a fixed time step h > 0, a large-deviations rate functional J h characterizes the behaviour of the particle system at t = h in terms of the initial distribution at t = 0. For the diffusion equation, a single step in the time-discretized entropy-Wasserstein gradient flow is characterized by the minimization of a functional K h . We establish a new connection between these systems by proving that J h and K h are equal up to second order in h as h → 0. This result gives a microscopic explanation of the origin of the entropy-Wasserstein gradient flow formulation of the diffusion equation. Simultaneously, the limit passage presented here gives a physically natural description of the underlying particle system by describing it as an entropic gradient flow.