Curiosity preformed the analysis on the soil using an instrument inside of it called Sample Analysis at Mars (SAM), according to DNews. SAM is equipped with a Gas Chromatograph (used to separate compounds into separate components), a Mass Spectrometer (used to measure masses and relative concentrations of atoms and molecules), and a Tunable Laser Spectrometer (used to measure concentrations of methane, carbon dioxide and water vapor and different isotopes of gases). It heated the soil up to 835C, and from inside the test chamber came water. While various minerals in the soil decomposed during the heating process, Curiosity also found sulphur dioxide, carbon dioxide and oxygen in the sample, according The Guardian.
The discovery may suggest a drinkable source of water for humankind in the future, but not without drawbacks. Mars is covered in a poisonous dust which contains perchlorate, a reactive chemical used in rocket fuel that interferes with human thyroid functions. The soil sample is composed of half a percent of perchlorate according to BBC News and New Scientist. The issue will have to be considered for human exploration of Mars.