Dogs have lots of adorable skills, but one of the most mysterious is their ability to sniff out medical conditions, such as some types of cancer, and dangerously low blood sugar levels in diabetics.

For the past few years, medical detection dogs have helped save diabetics' lives by acting as an early warning system for hypoglycaemia. But for the first time, scientists think they've now been able to figure out how canines are able to smell the condition. 

Medical detection dogs work by alerting or waking up their owners whenever their blood sugar level drops to the point of hypoglycaemia - a condition that can cause shakiness, loss of consciousness, and, if untreated, death. But researchers have never understood exactly how they pick up these blood sugar changes.

The new research suggests they're smelling a common chemical called isoprene, which is found on our breath.

Using mass spectrometry, scientists from the University of Cambridge in the UK studied the breaths of eight women with type 1 diabetes. They carefully lowered the women's blood sugar levels to the point of hypoglycaemia to see if there was any change in the chemical signatures of their exhalations that dogs might be able to detect. 

They found that isoprene increases significantly during hypoglycaemia - and in some cases it almost doubled.

While this change would be too subtle for us humans to smell, dogs have the ability to detect odours at concentrations of around one part per trillion, which is like the equivalent of us detecting a teaspoon of sugar in two Olympic sized swimming pools, as George Dvorsky explains for Gizmodo.

The team still isn't sure why the body produces more isoprene as blood sugar levels drop - they suspect it might be a byproduct of cholesterol - and more investigation is now needed to confirm their results.

But they conclude in the journal Diabetes Care that this is the cue that medical detection dogs are picking up. 

It's a small trial, so let's wait for further research before we get too excited. But what's really cool about this research is that it opens up the possibility for scientists to replicate dogs' abilities with medical sensors - which could then provide early warning systems for diabetics without the need for blood testing.

"It provides a 'scent' that could help us develop new tests for detecting hypoglycaemia and reducing the risk of potentially life-threatening complications for patients living with diabetes," said lead researcher, Mark Evans. "It's our vision that a new breath test could at least partly – but ideally completely – replace the current finger-prick test, which is inconvenient and painful for patients, and relatively expensive to administer."

Check out the video below to learn more about the research, and see Magic, the most adorable medical detection dog ever, in action. 

"Magic was just over 18 months when I got him and we've been together now for just over two and a half years and in that time he's alerted over 2,500 times," says Magic's owner, type 1 diabetic Claire Pesterfield, in the video. "Which is amazing when you think he's only doing it for a biscuit." Aww, what a hero.