As New Scientist explains, all previous discoveries of water have relied upon planets passing between its host star and the Earth. But exoplanets rarely "transit" in this manner, making it nigh-impossible to study their atmospheres.
So, the team took a different approach, observing both the planet and the star as they interacted with each other. For four hours, the telescope as pointed at both bodies, watching what light was reflected between the two.
One the data had been cleaned up, the team were able to draw a handful of conclusions about the celestial body. For instance, there is about 1 part in 10,000 of water in its atmosphere, with negligible quantities of carbon dioxide and methane.
Of course, we won't be able to validate their findings until someone's brave enough to head over to 51 Pegasi B for a look. Which might take a while, since the planet is closer to its sun than Mercury is to ours, and is hurtling around on a four day orbit.