The physics simulations shown on myPhysicsLab fall into two categories
An example in the "specialized" category is the cart + pendulum. That simulation works well, but it can only ever simulate that particular mechanism. You can vary the length of the pendulum, the mass of the objects, or spring stiffness. But you can't change how the parts are connected, or apply new forces, or collide with another object.
In contrast, the Rigid Body Physics Engine can model a wide variety of mechanisms. For example, here is the cart + pendulum with physics engine. Notice that you can drag the cart or pendulum by pressing the mouse button to activate a spring force -- this is not possible in the specialized version of the simulation.
It is remarkable that the Rigid Body Physics Engine is able to model so many different mechanisms with good accuracy. Here are some more examples:
The physics engine is composed of three classes that can be used separately (though we almost always use the last one).
More information about how the rigid body physics engine works is described in several places: