Hypotheses of the formation of Phobos and Deimos range from Mars impact remnants to captured asteroids (due to their similar size and composition to many asteroids).
Deimos - Credit: NASA/JPL/University of Arizona
Phobos - Credit: NASA/JPL/University of Arizona
Phobos' Stickney Impact Crater - Credit: NASA/JPL/University of Arizona