All trash compactors have essentially the same components and operate on the same principle.
Your trash compactor has these components:
A trash container, at the bottom of the unit.
A motor, at the top or bottom of the unit.
A flat, steel ram that's stored in the top of the unit.
When you put trash into the trash container, close the door, and press or turn the Start button, the motor starts. It rotates a set of reduction gears or a belt-and-pulley system that slowly lowers the ram.
The ram exerts tremendous pressure on the trash, which flattens it. When the ram pressure reaches its setpoint, the motor reverses and raises the ram back up to the top of the compactor.