The energies of any particular Hamiltonian are not necessarily discrete. The simplest example is the free Hamiltonian, $H = p^2/2m$, which has the spectrum $\mathbb{R}^{\ge 0}$. (Eigenstates are hard to define in this case since they are not technically states in the Hilbert space as they are not normalizeable, but a generalization is possible)
Many (most?) Hamiltonians have a spectrum with a discrete part and a continuous part. The discrete part is the energies of the bound states, while the continuous part is the energies of the unbound states. In the hydrogen atom, for example, the states with energy less than zero have the electron bound to the proton, but there is also a continuum of states where the electron is not bound to the proton.
As to why discrete spectra occur, it is for the same reason sound waves can form discrete spectra in certain systems (like a guitar string). The energy of a state corresponds to a frequency of oscillation of the wave function. The linearity of the wavefunction and reflection off boundary conditions mean certain discrete frequencies form resonances, and so you may get a discrete spectrum of energies. On the other hand, in the absence of boundaries and reflection sound waves can take on any form, corresponding to continuous spectra.
For more on the mathematics of the difference between continuous and discrete spectra and the generalization of eigenstates you can start with https://en.wikipedia.org/wiki/Spectral_theory