The extraordinary dynamics of microstructures, such as various dislocations, stacking faults, twinning, and polymorphism transformations, dominate the mechanical performance of high-entropy alloys. To reveal the phase transformation kinetics, we precisely detect the microstructure evolution in CoCrFeMnNi high-entropy alloy (HEA) and CrFeNi medium-entropy alloy (MEA) subjected to high-pressure compression using in situ angular-dispersive synchrotron X-ray diffraction. We find that controlling the initial microstructural state using cold-rolling can significantly reduce the stacking fault energy of CoCrFeMnNi and CrFeNi alloys, which results in lower onset pressures for phase transformations. The microstructure-induced stacking-fault energy reduction facilitates the formation of twins, which can act as nucleation sites for hexagonal close-packed (HCP) phase formation and recrystallization. The microstructure evolution-driven deviatoric deformation mechanism of CoCrFeMnNi HEA and CrFeNi MEA under quasi-hydrostatic compression is explored. Beyond the FCC phase, twinning in the HCP phase of CoCrFeMnNi alloy under high pressure is observed for the first time. This implies that the deformation mechanism of CoCrFeMnNi HEAs in the HCP phase is dominated by twinning-induced plasticity, which is verified using transmission electron microscopy.