A computer rendering of a spiral galaxy like the Milky Way taking shapeTakayuki Saito / Takaaki Takeda / Sorahiko Nukatani / 4D2U Project / NAOJ

We are made of star stuff, as Carl Sagan told us. The first stars ignited billions of years ago, out of the cold, primordial gas in the dark universe. The stars blazed until they exploded in bursts powerful enough to forge heavy chemical elements. The process repeated itself, over and over, all across space. The new elements found their way into other stars, and then planets, and, eventually, life.

It’s a remarkable cosmic tale, with a recent twist. Some of the stardust has managed to become sentient, work out its own history, and use that knowledge to better understand the stars.

Astronomers know stars so well, in fact, that they can tell when one doesn’t belong—when it’s migrated to our galaxy from a completely different one.

Today astronomers study the chemical compositions of stars near and far, from our own sun to the most distant points of light. They do it with the help of spectroscopy, a technique that is much cooler than its clinical name suggests. Astronomers take starlight, absorbed and collected by telescopes, and break it down into its constituent lines, same as a prism of glass stretches light into the colors of the rainbow. These lines correspond to different elements, from the light kind, such as hydrogen and helium, to the heavy stuff, such as gold and platinum.

Some stars have a signature that’s entirely distinct from their neighbors’, and there are a few of them in our very own galaxy, including one identified recently by a group of scientists based in Japan and another by an international team. The chemical compositions of these stars, their ratios of one element to another—those markers make them unlike any other star in the Milky Way, which is home to some tens of billions.

The stars in the Milky Way have similar chemical makeups because they emerged from the same clouds of gas, infused over time with a range of elements from the stellar explosions we call supernovae. “Stars are formed from gas, and whatever spilled into the gas prior to the formation ends up being in the star,” says Anna Frebel, an astronomer at MIT who has detected and studied one of these rogue stars. “It’s like genes that are being passed on.”

The chemical signatures of the interlopers suggest that they originated in environments without too many stellar explosions. For astronomers, this is a clear indication that the stars flickered on somewhere else.

How does this happen? The Milky Way, like many galaxies, is surrounded by other, smaller galaxies. “Just like the Earth has satellites, artificial and natural—man-made satellites and the moon—our galaxy also has satellites,” says Marion Dierickx, a postdoctoral fellow at the Harvard-Smithsonian Center for Astrophysics. “These occasionally fall in.”

The Milky Way has little trouble absorbing these galaxies and their contents when gravitational forces draw them near. “Our galaxy was built up over time as smaller galaxies collided and merged with each other,” says Douglas Boubert, a junior research fellow at Magdalen College at Oxford. “The oldest stars we see flying round the Milky Way today were all born in precursor galaxies.”

When galaxies merge, stars are jostled and settle into new orbits. So do planets and moons. The process is so slow, unfolding over millions of years, that any inhabitants of these planets, if they could fathom such things, wouldn’t know about the cosmic merger until millions of years after it happened. “We always think things are static in the cosmos, but they really are not,” Frebel says.

Astronomers have used spectroscopy to detect rogue stars in the satellite galaxies around our own. In 2011, they discovered that the composition of more than 5 percent of the stars inside the Large Magellanic Cloud didn’t match that of its other stellar residents. Those rogues resembled stars in the Small Magellanic Cloud, a nearby galaxy, instead. At some point, the larger cloud had stolen them away.

Astronomers say many more stars of this nature are in the Milky Way, but they are tricky to find. They orbit at the very edges of the galaxy; by the time their light reaches telescopes on Earth, it’s incredibly faint. “You can’t mount, at this point with our technology, a systematic campaign to identify these,” Dierickx says. “You find one candidate, you do thorough follow-up observations, and you come up with a detailed characterization—doing this kind of study for many stars would take a very long time.”

Dierickx recommends looking at these stars as a reminder of the Milky Way’s place in the cosmos. Vast expanses of space separate our galaxy from everything else, but the distances are not as insurmountable as they seem.

“That might be interesting, to the average layperson, to not think of our galaxy as living in splendid isolation in dark, empty space, but thinking of this richer picture with dozens of galaxies, satellites flying around in all directions and falling in every once in a while,” she says. “They really have contributed to building our Milky Way as we know it.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.