Like Jörmungandr encircling Earth, so too is the entire galaxy ringed. A huge, high-velocity stream of gas is wrapped most of the way around the Milky Way, at a distance of around 200,000 light-years.

We know where it comes from, more or less. It's been linked pretty conclusively with the Large and Small Magellanic Clouds, dwarf galaxies that orbit and will eventually be cannibalised by the Milky Way. This gives the cosmic serpent its name - the Magellanic Stream.

However, although chemically the Magellanic Stream matches up with the Magellanic Clouds, there's one aspect that has puzzled astronomers for decades - its mass. There's up to around a billion solar masses worth of gas in that stream, and models couldn't explain why the two satellite galaxies were losing that much.

"That's why," explained astronomer Elena D'Onghia of the University of Wisconsin-Madison, "we came out with a new solution that is excellent at explaining the mass of the stream."

According to their new model, the gas doesn't come from within the Magellanic Clouds themselves. Rather, it's pulled out from their galactic haloes - giant clouds of gas and plasma that envelop most galaxies.

magellanic streamAll-sky view of the Magellanic Stream. (D. Nidever et al., NRAO/AUI/NSF, A. Mellinger, Leiden-Argentine-Bonn Survey, Parkes Observatory, Westerbork Observatory, Arecibo Observatory)

The dance of the Magellanic Clouds and the Milky Way is an interesting one, with the two satellite galaxies orbiting each other, and then together orbiting the larger Milky Way. This complex interaction is warping all three galaxies, and the Milky Way is thought to be disrupting the Magellanic Clouds.

Previously, it was thought that tidal disruption from the Milky Way pulled out the Magellanic Stream as the two dwarf galaxies came into the Milky Way's sphere of gravitational influence. But this model could only account for about 10 percent of the observed mass of the stream.

"The stream is a 50-year puzzle," said astronomer Andrew Fox of the Space Telescope Science Institute. "We never had a good explanation of where it came from. What's really exciting is that we're closing in on an explanation now."

What's new here is recent research that suggests the Magellanic Clouds are massive enough to have their own haloes.

The team, led by astronomer Scott Lucchini of the University of Wisconsin-Madison, conducted their own simulations of the Magellanic Clouds being drawn into orbit around the Milky Way.

They calculated that the halo of warm gas around the Magellanic Clouds - dubbed the Magellanic Corona - would have dramatically altered the way the Magellanic Stream formed.

According to their simulations, the formation was a two-stage process. The first stage took place long before the Magellanic Clouds were captured by the Milky Way, but when they were still orbiting each other. The Large Magellanic Cloud stole a whole bunch of material from the Small Magellanic Cloud, losing a small amount of gas itself.

This process took about 5.7 billion years, eventuating in a halo of around 3 billion solar masses' worth of gas that enveloped the two galaxies as they were captured by the Milky Way. At this point, gravitational forces planted the seed for the Magellanic Stream, with the halo providing some 10 to 20 percent of its final mass.

animation mcAnimation of the simulation. (Elena D'Onghia and Scott Lucchini/University of Wisconsin-Madison)

In the second stage, after the two galaxies were captured in the Milky Way's orbit, interactions with our galaxy's gravity and own galactic halo pulled around a fifth of the Magellanic Corona's mass out to create the rest of the stream.

According to the team's simulations, this two-stage sequence of events reproduces the structure and mass of the Magellanic Stream, including the branch of the stream called the Leading Arm that orbits ahead of the two dwarf galaxies.

We're yet to detect the Magellanic Corona directly, but the team's model provides the toolkit to do so.

The cloud of gas should contain highly ionised states of carbon and silicon. Using the Hubble Space Telescope, we can look at distant quasars through the Magellanic Corona, and analyse their light to see if it travelled through significant clouds of these materials on its way to the Solar System.

"Background-quasar sightlines offer the chance for unambiguous detections of the Magellanic Corona, because they are uncontaminated by the Large Magellanic Cloud's interstellar material," the researchers wrote in their paper.

The research has been published in Nature.