# Why does simple harmonic motion occur?

If the mass of the object is constant then $F = m a$ applies and the acceleration will also be proportional to the displacement and directed toward the equilibrium.
A horizontal mass spring system will undergo SHM. The restoring force is given by $F = k x$ where $k$ is the spring constant and $x$ is the displacement. So $F \propto k$ and the force will always oppose the extension of the spring so it will act toward the equilibrium position.