What is the cause of discrete spectra in quantum mechanics? Both compact Lie groups and bounded Hamiltonians? What is the mathematical cause of the "quantum" in quantum mechanics? What causes some observables to take on discrete values? There seem to be two different causes, compactness of symmetry Lie groups, and bound states. I haven't been able to find a full explanation of either cause, and am also wondering whether they are both aspects of the same underlying mathematical phenomenon. Maybe I should have split this into two questions, but I'm hoping for an overarching answer.
Below I catalogue some of the answers I have been able to find, and why they fall short, which I hope will be a guide for what kind of answer I am looking for.
first: compact Lie groups lead to discrete spectra
On the Lie group side, I think the gist of it is that any quantum numbers live in the spectrum of a generator of a symmetry Lie group of the Lagrangian, and for a compact Lie group those spectra must be discrete.
This is why the angular momentum is a discrete quantum number, because the rotation group is compact. Linear momentum must also be discrete in a compact configuration space.
In this physics.se post Qmechanic says compactness is the source of all discreteness in quantum mechanics:

The discrete spectrum for Lie algebra generators of a compact Lie group, e.g. angular momentum operators.

The linked physics.se post physics.se has some handwavey physical descriptions and some more mentions of compactness.
In another physics.se answer by Qmechanic, we hear:

It is a standard result in representation theory, that for a finite-dimensional representation of a compact Lie group, that the charges (i.e., the eigenvalues of the CSA generators) take values in a discrete weight lattice.

But when this question is asked on math.se, they have never heard of any such result. All operators have discrete spectra in finite dimensional reps. Maybe it's the Peter–Weyl theorem, or maybe it's Pontryagin duality.
But when Qiaochu asks on MO about Pontryagin duality giving discrete dual groups to non-Abelian compact groups, the answer is complicated.
Baez has a writeup which touches on it:

Let me toss out a buzzword or two. Pontryagin duality. Compact <=> Discrete. Lie groups.


In other words, in phase space the harmonic oscillator just goes round in circles... or in other, buzzier words, we have an action of U(1) as symplectomorphisms of phase space. So when we quantize, since nothing much goes wrong, we get an action of U(1) on a Hilbert space; the self-adjoint generator - the Hamiltonian - thus has integer spectrum.

Question 1: Is it standard fact of weights of a Lie algebra being discrete, or Pontryagin duality, or Peter-Weyl theorem
I don't see how any of these mathematical facts allow us to deduce discreteness of the spectra of the generators of a compact Lie group.

*

*the root system of the Cartan subalgebra of a Lie algebra is discrete I guess because the Lie algebra and its Cartan subalgebra are finite dimensional. It doesn't appear to have anything to do with the compactness of the Lie group. In particular, Lie algebras like $\mathfrak{sl}_n$ have discrete root systems, despite the Lie groups not being compact.


*Pontryagin duality tells us that the dual group of a compact LCA is discrete. What does this tell us about the spectrum of Lie group generators? Do those comprise the dual group in some way?


*The Peter–Weyl theorem tells us that a unitary representation of a compact group decomposes into a direct sum of finitely many orthogonal irreps. What does this tell us about the spectrum of generators of the group?


*We know that a faithful rep of a non-compact group cannot be both finite dimensional and unitary. Generators of compact groups are anti-Hermitian, but made Hermitian in the physics convention of factoring out an $i$. So the generators of the non-compact directions of the Poincaré group are not Hermitian. Does tell us anything about the relationship between compactness of the group and discreteness of the spectrum?
second: bounded Hamiltonians lead to a discrete spectrum of bound states
A free particle Hamiltonian has a continuous spectrum, while the spectrum of bound particles like a box potential or a harmonic oscillator is discrete. Why?
In this physics.se post it is discussed that Sturm–Liouville theory gives us a compact operator.
The spectral theorem for compact operators on a Hilbert space does tell us that they have discrete spectra or at worst, an accumulation of eigenvalues at zero.
But in general Hamiltonians or generators of a Lie group can be non-compact as operators on Hilbert space. And in general an unbounded operator can have a point spectrum, a continuous spectrum, as well as a residual spectrum, due to the Lebesgue decomposition theorem.
question 2: what criteria can we put on an unbounded operator on Hilbert space to guarantee a discrete spectrum, like for the Hamiltonian of free/bound systems
Is there any relationship between the discrete spectrum we expect for generators of a compact Lie group, and the discrete spectrum we expect for bound states? Is there a hidden compact Lie group at work on this Hamiltonian?
These seem more like math questions than physics, but since it was already asked on m.se with no answer, I thought I would try here. Plus some people here like Qmechanic seem like they may have good answers.
 A: Regarding the first issue, yes the Peter-Weyl theorem is the answer. The Hilbert space is the direct sum of finite dimensional invariant mutually orthogonal subspaces. Every selfadjoint generator is therefore also decomposed according to these subspaces (the proof of this fact is a bit delicate due to possible problems with domains, but it works). The total spectrum of the generator decomposed that way  is the closure of the union of the spectra computed  in each invariant  subspace. As each subspace is finite dimensional, a generator is there a Hermitian matrix, so that its spectrum can be only a point spectrum. We conclude that the complete spectrum is a point spectrum with, possibly, some points of continuous spectrum made of boundary points. In all cases, there is a Hilbert basis made of proper eigenvectors: the union of the eigenvectors in each invariant subspace.
I stress that if the group is not compact, some selfadjoint generator may have a pure point spectrum. There are several non-trivial examples as $PSL(2, R)$.
The second issue is much more difficult. A mathematical approach consists of studying a real function of the operator and proving that this new operator is compact so that it has a pure point spectrum. From that if the function is sufficiently good (typically the function defines the resolvent operator of the operator), we can infer that the operator itself has pure point spectrum even if it is not compact. That is the case for instance for the Hamiltonian $H$ of the harmonic oscillator. Here $1/H$ is compact.
The fact that the physical  space is bounded (think of the quantization in a box) does not automatically implies that the spectrum is discrete: think of the position operator in a box.
A: Not sure if this is what you're looking for, but consider the angular momentum operator in the z direction
$$
\hat L_z = \frac{\hbar}{i} \frac{\partial}{\partial \phi}.
$$
Any wave function $\psi(r, \theta, \phi)$ must satisfy
$$
\psi(r, \theta, \phi + 2 \pi) = \psi(r, \theta, \phi).
$$
Because
$$
e^{-i \alpha \hat L_z / \hbar} \psi(r, \theta, \phi) =e^{\alpha \partial / \partial \phi} \psi(r, \theta, \phi) = \psi(r, \theta, \phi + \alpha)
$$
then we must have
$$
e^{- i 2 \pi \hat L_z / \hbar} = 1.
$$
The above condition is the exact sort of thing you'd get for any generator for a compact group. The subgroup of the rotation group parameterized by exponentiating $\hat L_z$ is just $U(1)$, meaning a $2 \pi$ rotation must return to the identity. Therefore, if a state has an eigenvalue under $\hat L_z$, say $\lambda$, then it immediately follows that
$$
e^{- i 2 \pi \lambda / \hbar} = 1
$$
so
$$
\lambda = \hbar n
$$
where $n$ is an integer. This is the reason why the operators which generate compact groups have discrete eigenvalues.
