Looking at dunes and other rock formations on both Earth and Mars can tell scientists the environmental conditions that created them