The current draw of the motor is what makes the motor reverse. The ram reaches the garbage and it requires more energy to compact, so the amperage draw of the motor goes up and it triggers the reverse action. I suspect the lower gears (both plastic, numbers 6 & 10) may have some worn or broken teeth and are not engaging correctly and jumping teeth when the motor is strained. You can lay the machine on its side and remove the lower cover for inspection. This is a very messy job as there is a lot of grease in there, so lay an old blanket or something down under the machine. If you find those gears are indeed broken or worn, the kit at the link below is what you will need to install.
Whirlpool 882699 Drive Gear Kit - AppliancePartsPros.com