By shifting training loads -- the volume of swimming, running or weightlifting, for example -- the body is better able to recover while keeping muscles strong. Athletes are also smarter about what they put in their bodies.
"We know so much more about nutrition," Wells added. "You can use nutrition to make you stronger, keep you healthy without getting sick, even to improve brain function to concentrate more."
U.S. swimmer Ryan Lochte credited his junk-food-free diet with his success at the 2012 London Olympics.
RELATED: Olympic Tech for Athletes and Fans
The third big piece is injury recovery and sleep, explained Wells.
Athletes use massage therapy and ice baths to eliminate inflammation of the muscles that occur after hard training or competition. Compression tights, socks or other garments can help reduce muscle soreness. They also use special night lights, music or other methods to maintain adequate sleep as they travel the world to qualify for the Olympics.
"People are now approaching sports as 24-hour-a-day athletes," Wells said. "It used to be that you were only an athlete at the workout."
Aging athletes also have to work harder to keep their muscles from decaying, a process that begins in your 30s and can amount to a 1 to 2 percent loss annually beginning in your 40s.
RELATED: Genetic Switch Starts Aging Clock
"It's certainly a case of 'use it or lose it,'" said Geoff Power, assistant professor at the Neuromechanical Performance Research Laboratory at the University of Guelph (Ontario). "You have to maintain a certain amount of intensity. Just going for a walk may not be sufficient."
In a 2016 study published in the Journal of Applied Physiology, Power and collaborators flew masters athletes, those who competed in running events in their 80s, from around the world to a laboratory at McGill University.
They found some interesting physiological properties of these competitors; they were able to maintain the number of "motor units" (a neuron in the spine that connect to muscle fibers) while regular folks lose them rapidly between 60 and 80.
RELATED: Humans Could Live 30 Years Longer
"These athletes maintain the number of motor units, and that may be responsible for why they can compete at that level," Power said. "Is it because they are highly active or some genetic predisposition? That's the next question for research."
Some of the 80-year-olds didn't start exercising until their 40s, but maintain a high level of exercise and strength for many years, Power said.
Other recent studies have shown that the average age of athletes is actually getting older. Andrew Cornett, professor of exercise science at Eastern Michigan University believes that "late bloomers," or individuals who enter sexual maturity later as teenagers, also have the same physiological characteristics as top athletes. They end up being leaner, taller and having a lower body-mass index (BMI).
"The most common explanation is that it's the training that delays menarchy [sexual maturity in females]," Cornett said. "That's why high level athletes tend to be later maturers."
The typical age at menarchy in the general population is 12.5 years. For college swimmers, that shifts to 13.6 years," Cornett said.
How does this relate to older elite athletes? Late bloomers have more opportunities to compete in sports after they finish college than in previous decades, Cornett said, so the population of older elite athletes is growing over time.
As for Michael Phelps, Cornett said it's difficult to know if he is slowing down or if other swimmers are finally catching up with him. When Phelps was at his peak in 2008, he was winning by huge margins. However, his times were inflated (along with all other swimmers) because of a high-tech full-body swimsuit that was banned after the Beijing Games.
"He's getting relatively older for a high level swimmer," Cornett said. "But if you are the best in the world by a lot in your early to mid-20s, it's not surprising that you would still be up there with the best in the world in your early 30s."