You have seen how gravity makes two massive bodies interact with each other. The obvious question is what happens if we introduce a third body? This question actually troubled Newton when he first discovered the laws of physics relating to gravity. Newton was able to solve the equations of motion for two bodies and demonstrate that orbits are typically elliptical. But when he constructed the system of equations for three or more bodies, he was unable to solve the equations for the general case. Some situations are solvable, for example when the bodies and their velocities are in line. But the general case eluded solution, right to the present day.
However, with present day computers we can simulate three, or bodies, and see what happens. In this simulation you can control the starting distances, speed and masses of a Moon and satellite to see what happens. You will notice that in most situations the motions can be chaotic, and this is why physicists have had some difficulty finding relatively simple equations to describe such behaiviour.
In this simulation I have included a simple spring and damper model of collisions between bodies. The spring represents the behaviour of two bodies bouncing off each other. The damper represents the loss of kinetic energy in the collision. When the damping coefficient is high bodies will tend to clump together when they collide. The simple collision model also demonstrates some interesting behaviour where bodies can transfer their kinetic energy to other bodies. For example the star (Simulatneous multiple collisions are not modelled yet, so you may see odd behaviour when all three bodies collide with each other)