Why does SHM happen in vacuum? Very simply put, I don't understand why SHM happens.
If a spring or a pendulum can attain lowest potential energy by stopping at the mean position, why don't both of them stop at the mean position itself? ( Assuming that there are no damping forces)
 A: The spring or pendulum does not stop at the lowest point having lowest energy because it still has kinetic energy at that point and hence goes up in which in loses its kinetic energy and gains potential energy and this cycle continues in vacuum as there is no damping.
A: to enlarge slightly upon Black Thunder's answer, the inertial forces and compliance forces in a mechanical oscillator are out of phase which causes the inertance (mass) in the system to overshoot its rest position. The system then oscillates.
A: It's easy to see why it happens in vacuum: Energy is conservated in absence of external forces. As you can see, if you set a pendulum to a certain height then let it swing, you've given it some potential energy proportional to how much you displaced it from its equilibrium point (assuming there's gravity). This energy will set the pendulum in a SHM, so, when it's back to its rest position, it will have turned into kinematic energy, that will take it back up on the opposite direction, and so on...
A: The harmonic oscillator is a costant fight between the reset force and inertia of the object.Let's say the object is not at rest position .Then the reset force accelerates the object to that position. When the rest position is reached, the object has some velocity and the inertia of the object wants to keep having the same velocity regardless of the reset force which pushes the object away from the rest position.And the same thing happens again and again until due to friction the object loses its kinetic energy.
A: if you hold a pendulum to a height then let it swing, it has some potential energy proportional to the  displacement  from its equilibrium point.  This energy will set it in SHM and when ii comes back to its rest position, it will be converted to  kinematic energy,
