Sword swallowers are often thought of as magicians or illusionists. Although there are plenty of arcane skills they have to learn, there's no real 'trick' to their work. They don't use blades that collapse down, or insert them down the collar of their shirt or use smoke and mirrors. They just swallow a sword.
It can take years to learn to swallow a sword, mainly because it requires the use of muscles people usually don't have control over. Even the mechanism of swallowing, which people do have conscious control over, is used unconsciously so often that it takes time to relearn certain tricks (which is why it takes practice to learn how to dry-swallow pills). Once something is inside the throat peristalsis takes over. Peristalsis, the contraction of the esophageal tract which pushes food down towards the stomach, is done by smooth muscles that the body can't generally intentionally relax.
In order to swallow the sword, a swallower will have to first deliberately relax the ring of muscles which closes the opening to the esophagus, and then find a way to keep the rest of the upper gastrointestinal tract from squeezing against the sword. No minor feat, considering the sword sometimes penetrates the lower esophageal sphincter, another ring of muscles, and dips down into the stomach.
The swallower also has to get in the right position, pushing back his or her head to line up the mouth with the stomach. The sword also helps the process. As it goes down, lubricated with spit, or sometimes vegetable oil, it gently pushes aside organs like the heart and the trachea - which the esophagus curves by. The Sword Swallowers Association International will not recognize a sword swallower unless they can swallow down a sword two centimeters wide and 38 centimeters long, but swords can be up to 80 centimeters long.
Training for a sword swallower means doing away with the gag reflex entirely. This is not done prettily. Generally, trainees trigger the reflex over and over, vomiting up stomach acid, which can eat away at their teeth and their esophageal tract. The tract is also traumatized when the process is repeated, when fingers don't suffice, with pretty much anything the swallower can get their hands on. A study mentioned that trainees tried, "spoons, paint brushes, knitting needles, and plastic tubes before the swallower commonly progresses to a bent wire coat hanger." The esophageal tract degradation is a real problem, since it has to be strong enough to survive a sword sliding down it again and again.
In 2006, a study was done on sword swallowers and their common health problems. The study authors wanted a narrow focus, and took pains to stress that they only looked at the health difficulties and injuries of people who swallowed swords, stating, "We excluded cases in which injury was related to swallowing items other than swords, such as glass, neon tubes, spear guns, or jack hammers." Yes. Jack hammers.
The most common complaint was, naturally, a sore throat. Sometimes very sore. Roughly a third of reporting swallowers had experienced perforations in the throat. Three others thought they had perforations, but hadn't sought medical treatment to confirm. One was told that the sword came too close to his heart, leading to inflamation of the sac that protects the heart from injury. All but three had experienced intestinal bleeding, and one "had had a bread knife removed transabdominally."
Generally, though, the biggest predictor of an bloody performance is an earlier awful performance. Although sword swallowers have done everything they can to stop any internal squeezing, instincts will kick back in if the upper gastrointestinal tract gets too irritated. After too many performances, or one bad one, the internal tract can grow dry, or hypersensitive, causing a performer to gag around the sword. This either causes the perforation itself or it can cause a inexperienced performer to panic and try to pull the swords out too quickly.
Random chance, and stupidity, can also play a role. One sword swallower was badly injured when a man from the crowd decided to push money into her belt. She had multiple swords inside her, and they 'scissored.' One hopes that she had the presence of mind to draw all the swords out and throw them at him.