Help me understand how Pulse-Amplitude Modulation (PAM) works
If you define pulse amplitude modulation (PAM) as a method where a train of pulses is generated with the information coded by the amplitude of these pulses then both methods comply with that definition.

In analog PAM, the amplitudes are defined by samples of the analog source signal, whereas in digital PAM, the amplitudes are discrete and are defined by the bit pattern and some fixed mapping between bit patterns and discrete amplitude values.

In both cases, the PAM signal is given by

$$s(t)=\sum_kA_kp(t-kT)\tag{1}$$

where $A_k$ are the amplitudes representing the analog or digital source signal, $p(t)$ is the pulse, and $T$ is the symbol rate.

The signal $(1)$ is a baseband PAM signal, which can be modulated by a carrier to obtain passband PAM. Using complex symbols $A_k$ on a rectangular grid in the complex plane and two orthogonal carriers gives you quadrature amplitude modulation (QAM). Take a look at this answer for more information on passband PAM.