Basically if you knock the side of the cup then you enact a force on that side that then enacts the same force on to the liquid inside. This force causes it to splash to the opposite side and leave the edge of the cup, meaning it spills.
When you put the drink on the Topple Tray, you are holding the handle at the top and causing a new centre point at the top of that handle. By holding it loosely you allow the tray to move freely and if any lateral force was applied to your hand (someone bumped into you) then this does not translate to the handle or the tray or the side of the cup. Everything on the tray will swing together in the same direction. Gravity and the normal force end up working together and go in the same direction as the force that knocked the cup resulting in equal acceleration to the tray, cup and liquid meaning no spill.