Scientists looked at X-ray fluorescence data from MESSENGER, which has orbited Mercury since March 2011. They found something puzzling during their analysis; namely, there were two distinct types of rock composition on Mercury's surface.
In order to figure out what geological processes could have lead to this, the scientists used their data to create synthetic replicas of the two rock types in the lab, which they then subjected to high temperatures and pressures to simulate different geological processes.
From the resulting data, the scientists posited the only likely explanation to explain the rock composition: Mercury once contained a magma ocean that solidified over time, forming one type of rock, before melting again and erupting to the planet's surface as lava during a period of intense volcanic activity.
The magma ocean was likely a product of the violence that formed the planet. Mercury, like every other planet in the solar system, including our Earth, formed out of vast clouds of gas and debris orbiting the sun. This was a very violent process, involving collisions of huge objects that eventually merged together into a single whole. It seems plausible that the heat of such collisions could have melted and re-melted Mercury's rocks, resulting in the formations we see today.