What causes simple harmonic motion?
Consider the simplest case of a particle of mass
The system is considered 1 dimensional for simplification.
Now suppose the particle is displaced by an amount
Whenever, the external force is removed, this restoring force tends to restore the particle to it's equilibrium. Thus it accelerates the particle towards to equilibrium position. However, as soon as the particle reaches equilibrium, the force vanishes but the particle has already gained some velocity due to previous acceleration. Thus, the particle continues to move towards the other side of the equilibrium position and then again a force develops tending to pull it back.
This was, in absence of damping forces, the particle continues it's to and fro motion about the equilibrium potion.
This is what constitutes a simple harmonic motion.
However, spring forces are often not linearly proportional to the displacement. However, for small amounts of displacement, the restoring force can always be found to be proportional to the displacement of the particle from the mean position.