On Earth, geologists can dig holes and pull up core samples to find out what lies beneath the surface. On Mars, geologists cannot dig holes very easily themselves, but a process has been occurring for billions of years that has been digging holes for them: impact cratering.
Impact craters form when an asteroid, meteoroid, or comet crashes into a planet’s surface, causing an explosion. The energy of the explosion, and the resulting size of the impact crater, depends on the size and density of the impactor, as well as the properties of the surface it hits. In general, the larger and denser the impactor, the larger the crater it will form. [More at link]