Spherical harmonics arise as the azimuthal and zenithal components of solutions to the Schrodinger equation for any spherically symmetric potential. In nature, such a potential really only arises in atoms for the case of hydrogen (due to the lack of other electrons, which break this symmetry), but as you might expect can also describe certain other limiting cases where the potential is approximately spherically symmetric quite well. An example of this is an alkali atomic species -- lithium, potassium, sodium, and so on -- where the single electron in the valence shell is excited to what is called a Rydberg state. If you're familiar with the usual set of quantum numbers applicable to atoms, a Rydberg state is where the principal quantum number n is quite large, usually around 60 or so. In this limit, the single valence electron is far enough away from all the other electrons that their angular non-uniformities can be neglected, and hence the resulting potential seen by the valence electron is approximately spherically symmetric.
Another thing about the spherical harmonics is that they're also just a generally applicable, linearly independent basis of functions with purely angular dependence, so we can, in principle, use them to decompose any angular wavefunction -- whether the specific harmonic for a given set of quantum numbers is an eigenstate of the angular Hamiltonian or not.
EDIT: For completeness, I should note -- in case anyone's not so familiar, the numbers that index the spherical harmonics are called quantum numbers when used to describe atomic orbitals. Physically, the positive-or-zero index gives the orbital angular momentum of the particle whose wavefunction it applies to, and the positive-or-negative index gives the projection of the orbital angular momentum onto a specific axis.
Check out “the orbitron”: https://winter.group.shef.ac.uk/orbitron/