The composition of perovskite has been optimized combinatorially such that it often contains six components (AxByC1-x-yPbXzY3-z) in state-of-art perovskite solar cells. Questions remain regarding the precise role of each component, and the lack of a mechanistic explanation limits the practical exploration of the large and growing chemical space. Here, aided by transient photoluminescence microscopy, we find that, in perovskite single crystals, carrier diffusivity is in fact independent of composition. In polycrystalline thin films, the different compositions play a crucial role in carrier diffusion. We report that methylammonium (MA)-based films show a high carrier diffusivity of 0.047 cm2 s-1, while MA-free mixed caesium-formamidinium (CsFA) films exhibit an order of magnitude lower diffusivity. Elemental composition studies show that CsFA grains display a graded composition. This curtails electron diffusion in these films, as seen in both vertical carrier transport and surface potential studies. Incorporation of MA leads to a uniform grain core-to-edge composition, giving rise to a diffusivity of 0.034 cm2 s-1 in CsMAFA films. A model that invokes competing crystallization processes allows us to account for this finding, and suggests further strategies to achieve homogeneous crystallization for the benefit of perovskite optoelectronics.