This is a design that allows a person to purchase an item and receive a bonus item. The chest has 1 item in it that can be bought (larger stack sizes require figuring out the comperator output). When this item is bought the comperator turns off, allowing the hopper to fill 1 item into the chest, which turns the comperator back on. This off then on allows both 1 shot from the dispenser and 1 item to refill via hopper. To see it in action go to /res tp thirds and head left.