This is a generic result that applies when a mass is close to a local minimum in a potential energy function, such that the function is approximated by a parabola. Of course, including higher order terms like the cubic term allows for asymmetry in this potential function (i.e. one side is "steeper" than another side).
Extending these ideas, if we think about a potential function in two spatial dimensions, we could also have "saddle-shaped" potentials, where the local equilibrium is stable in one direction but unstable in the perpendicular direction.
6. Concluding Remarks
The mathematics of classical oscillations tends to involve similar techniques, even if the equations may arise out of "different physics". For example, in RLC circuits, we have charges (rather than masses) oscillating due to Maxwell's laws in capacitors and inductors. A balloon may experience oscillations measured in terms of its volume as opposed to a linear dimension.
Tips: Work through enough problems to know how to arrive at the mathematical equations based on the physics. For most questions, you will likely make reasonable approximations ("small oscillations") so that the resulting equations simplify, to leading order, into the form of the SHM equation.
7. Supplementary Questions