Same principles at work as with a Polish Cannon, create pressure and eject something...in this case it is golfballs...the Polish Cannon's I made of regular size soup cans would shoot tennis balls and we would use lighter fluid as the fuel. I also made one for golf balls using those little tomato paste cans, but being lighter fluid powered meant they wouldn't go as far as the tennis balls.
This thing looks easier and more fun!
https://westernrifleshooters.wordpress.com/2015/06/05/gas-powered-cannon/Four!!!