Two objects coming nearer to each other through space will have a mutual gravitational attraction. Given their masses and velocity vectors one can calculate the required escape and orbital velocities. Assuming they are not on an actual collision course, if their velocities exceed the escape velocities then the objects will pass by each other and never meet again. If their velocities exceed the orbital velocities but not the escape velocities then they will orbit each other. And if their velocities are below the orbital velocities then they will collide.
AbE: Moons and planets without dense atmospheres or plate tectonics are a record of past collisions, for example, Mercury and our own moon.
Edited by Percy, : AbE.