Behind the curtain
The program needs a calibration: a few seconds of you looking at each ball while it knows which ball that is. Telling you "look at the red ball" would give the secret away. The ritual gives you a reason to do exactly that. Breathing with closed eyes keeps your head still, and the smoke tells your eyes where to go next. Magicians call this misdirection: the story hides the method. While the program records, the screen also shows no words and the magician speaks instead, because eyes jump to any text they can read.
A webcam is a rough eye tracker. Lab eye trackers shine infrared light on the eye and film it with a fast, close-up camera. A webcam sees your iris as a small patch of pixels, so its guess is often off by a few centimetres on the screen. It can tell left, middle and right apart, but it could not tell which word you are reading. That is why the balls are big and far apart, and why the smoke ritual comes first.
People tend to look longer at the option they end up choosing, and looking at an option can also nudge the choice toward it. Here you looked on purpose. In research, the same measure is taken while people simply decide, and it can predict the choice before they make it. Tools such as WebGazer.js let researchers run these studies online with ordinary webcams.
Shimojo, Simion, Shimojo & Scheier (2003), Nature Neuroscience, "Gaze bias both reflects and influences preference." Krajbich, Armel & Rangel (2010), Nature Neuroscience, "Visual fixations and the computation and comparison of value in simple choice."