On the left is " Wopmay" rock, in Endurance Crater, Meridiani Planum, as studied by the Opportunity rover. On the right are the rocks of the "Sheepbed" unit in Yellowknife Bay, in Gale Crater, as seen by Curiosity.
The rock on the left is formed from sulfate-rich sandstone. Scientists think the particles were in part formed and cemented in the presence of water. They also think the concretions (spherical bumps distributed across rock face) were formed in the presence of water. The Meridiani rocks record an ancient aqueous environment that likely was not habitable due the extremely high acidity of the water, the very limited chemical gradients that would have restricted energy available, and the extreme salinity that would have impeded microbial metabolism -- if microrganisms had ever been present.
In the Sheepbed image on the right, these very fine-grained sediments represent the record of an ancient habitable environment. The Sheepbed sediments were likely deposited under water. Scientists think the water cemented the sediments, and also formed the concretions. The rock was then fractured and filled with sulfate minerals when water flowed through subsurface fracture networks (white lines running through rock). Data from several instruments on Curiosity -- the Alpha Particle X-ray Spectrometer, the Chemistry and Camera instrument, the Chemistry and Mineralogy instrument, the Mars Hand Lens Imager, the Mast Camera, and the Sample Analysis at Mars instrument -- all support these interpretations. They indicate a habitable environment characterized by neutral pH, chemical gradients that would have created energy for microbes, and a distinctly low salinity, which would have helped metabolism if microorganisms had ever been present.
Both color images have been white–balanced using the same technique to show roughly what they would look like if they were on Earth.
The "true color" image from Opportunity's panoramic camera (Pancam) was acquired on Sol 250 (the 250th Martian day of Opportunity's operations, which was Oct. 6, 2004, on Earth).
The image from Sheepbed was from Curiosity's Mast Camera on Sol 192 (the 192d Martian day of Curiosity's operations, which was Feb. 18, 2013, on Earth).