It's hardly any different with electric motors. The power electronics determine how it feels, how efficiently it works and how spontaneously it carries out the driver's commands. Their task is to send as many electrons as possible from the drive batteries into the windings of the electric motor without generating too much wastage from the internal resistance of the lines or internal switching losses. Ideally, the almost massless elementary particles travel at the speed of light along this path. This also explains the completely different, very direct response behavior of electric engines compared to combustion engines with liquid or gaseous fuels.
The crucial components here are the power semiconductors. Similar to how fuel injectors regulate the amount of fuel, they stand in the way of electrons, at least in the idle state. The semiconductor only clears the way when voltage is applied or an electric field is generated.