Basic principle is simple, it works because of action-reaction force pair, like here in the picture,

You throw boxes out of car with force,
$$ \tag 1 F_{\text{thrust}} = \dot m v_e, $$
where $v_e$ is exhaust velocity and $\dot m$ is car mass change over time in $[kg/s]$ and same force exhaust applies to your car due to Third Newton law. By analogy $\dot m$ measures how much such people you have standing on a trolley. The more you have,- the more boxes they can throw out per time unit,- each with momentum $m_{box}v_e$ and as such total force passed back to trolley scales-up linearly. But core rocket moving principle is as primitive as gun recoil.
The difference being is that in rocket case we favor recoil and try to maximize it by any means, for example by choosing favorable nozzle which accelerates gas flow, since full rocket thrust equation is,
$$ \tag 2 F_{rocket} = \dot m v_e + \Delta pA_e ,$$
where $\Delta p $ is pressure difference between nozzle input and output, and $A_e$- nozzle exit cross-section. So, in conclusion you can call rocket "a maximized recoil system."