Sword swallowing is not just an elaborate visual trick. Trained performers really do stick at least 16 inches of blade into their bodies. The key? It’s all in the esophagus.

In order to master the ancient art of sword swallowing, enthusiasts spend years practicing and learning how to wield control over involuntary bodily reflexes. First, sword swallowers have to learn to master their gag reflex. As a 2006 study of sword swallowers describes, performers train by “repeatedly putting fingers down the throat, but other objects are used including spoons, paint brushes, knitting needles, and plastic tubes before the swallower commonly progresses to a bent wire coat hanger.” It goes on to note that “sore throats are common.”

The sword has to pass through the upper esophageal sphincter—the muscles at the top of the esophagus that you use when burping, eating, vomiting, etc. Then, the sword swallower has to bend their body so that the blade passes around their heart. Finally, the sword must move through the lower esophageal sphincter, the entrance to the stomach. These muscles move involuntarily—they’re what keep the contents of your stomach from creeping back up your throat—and when one weakens these, it can cause acid reflux.

Through intense training, sword swallowers learn to open this sphincter on command, allowing the sword to pass into the stomach. One practitioner told The Washington Post that she didn’t even know how she did it, using only intense concentration to relax the muscles. Eventually, a sword swallower can learn to hold multiple swords in his or her throat at once (the world record for most swords swallowed at once is 52, set by Red Stuart in 2009.)

And yes, it’s dangerous. With one wrong move, sword swallowers can poke holes in their throats and otherwise damage their internal organs. But when done right, it’s an incredible feat of bodily control.

Read more about the lives of sword swallowers from The Washington Post.