Dalton Prager, a young man who received national attention because both he and his wife had cystic fibrosis, died this weekend of the disease at age 25. But why does cystic fibrosis shorten lives?

Prager met his wife, Katie, online when the two were 18-year-olds, according to CNN. Because they both had cystic fibrosis, they were warned against ever meeting in person, since two people with the condition can spread bacteria to each other, which can result in life-threatening infections.

But the pair met anyway, and had a five-year marriage before Dalton's death on Saturday (Sept. 17), CNN said. Katie is currently receiving hospice care for cystic fibrosis at her home in Kentucky. The couple's story has been compared to the novel "The Fault in Our Stars" by John Green (Dutton Books, 2012), which tells the story of two teens with terminal cancer who meet and fall in love. 

Cystic fibrosis is a genetic condition in which the body produces abnormally thick mucus, which builds up in the lungs, pancreas and digestive tract. As a result, the condition causes breathing and digestive problems, according to the Cystic Fibrosis Foundation (CFF).

Excessive mucus in the lungs creates an ideal place for bacteria to thrive and multiply, the CFF says. This means that patients with cystic fibrosis are at high risk for lung infections, often from bacteria that don't typically cause symptoms in healthy people. In addition, the body's immune system’s response to these infections results in inflammation that can lead to even more lung damage. As a result, lung infections can be dangerous for cystic fibrosis patients, and over time, lead to worsening lung health and death, the CFF says.

Extra mucus in the pancreas can also block the release of enzymes that are important for digestion, which prevents patients from absorbing vital nutrients from the food they eat, and can result in malnutrition, the CFF says.

Advances in treatments for cystic fibrosis have greatly increase life expectancy for people with the disease, but it remains a life-shortening illness. In the 1950s, children with the condition often did not survive long enough to attend elementary school, whereas those born in 2010 are projected to have a life expectancy of 39 years, according to a 2014 paper. More than 30,000 people in the U.S. are living with cycstic fibrosis, according to the CFF.

Before Dalton and Katie met, Dalton was infected with Burkholderia cepacia, a bacteria that can cause dangerous lung infections in people with cystic fibrosis. Katie did not have the infection, but knew that meeting Dalton would put her at high risk for contracting the bacteria, according to CNN. Indeed, the CFF recommends that two people with cystic fibrosis should be kept a minimum of 6 feet (2 meters) apart because of the risk of cross-infection between people with the disease. Katie did eventually contract the bacteria from Dalton, but told CNN that she had no regrets.

"It gave me some of the best years of my life," Katie was quoted as saying. "I'd rather have five years of being in love and just really completely happy than 20 years of not having anybody."

Original article on Live Science.

Copyright 2016 LiveScience, a Purch company. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.