One idea is that Phobos is a captured asteroid. ... It is possible that Phobos formed in situ at Mars, from ejecta from impacts on the Martian surface, or from the remnants of a previous moon which had formed from the Martian accretion disc and subsequently collided with a body from the asteroid belt.
How were Phobos and Deimos formed?
The moons of Mars may have started with a huge collision with a protoplanet one third the mass of Mars that formed a ring around Mars. The inner part of the ring formed a large moon. Gravitational interactions between this moon and the outer ring formed Phobos and Deimos.
What is Phobos made up of?
Phobos and Deimos appear to be composed of C-type rock, similar to blackish carbonaceous chondrite asteroids.