It looks like an old practice golf ball lol. It tells the game when the hoped is full so it diverts the in coming coins to the cashbox under the machine.
It hangs there and as the hopper fills it is pushed up by the coins until it activates the switch. Basic but clever I thought