Plasma equilibria reconstructed from the Mega-Amp Spherical Tokamak have sufficient resolution to capture plasma evolution during the short period between edge-localized modes (ELMs). Immediately after the ELM, steep gradients in pressure, P, and density, n(e), form pedestals close to the separatrix, and they then expand into the core. Local gyrokinetic analysis over the ELM cycle reveals the dominant microinstabilities at perpendicular wavelengths of the order of the ion Larmor radius. These are kinetic ballooning modes in the pedestal and microtearing modes in the core close to the pedestal top. The evolving growth rate spectra, supported by gyrokinetic analysis using artificial local equilibrium scans, suggest a new physical picture for the formation and arrest of this pedestal.