Molecular Dynamics (MD) simulations carry out mechanics according to certain physical laws, usually Newton’s laws. Say you have a box with some 1000 or 10000 particles. The program keeps track of all particles’ positions and velocities, and develops the system in small time steps. In each time step, it calculates the force on each particle, and then updates the positions and velocities according to these forces (using Newton’s laws). The detail that is different from system to system is the prescription on how the particles in the system interact, i.e. what forces a particle feels from all other particles (and the box walls*). So you might have soft particles (and there are many ways of being soft) or hard particles (like billard balls, or hard ellipsoids), you might have attraction and only repulsion when they come very close (like atoms in silicates), or purely repulsive particles (like hard ellipsoids).
* But in many cases people don’t actually have walls in their systems: they use “periodic boundary conditions”. This means that if a particle flies out on one side of the box, it simply flies back in on the other. And similarly, the particle feels the particles from the other side. This trick is good when you don’t want effects from the walls, but the behavior deep inside the system, and that’s a very common interest (and my interest).
Simulations in general