The equation you gave is showing an alternate expression of the $R_z$ rotation gate that differs from the definition by a global phase. This can be made clear if we use a different symbol for the phase difference:
$$ \begin{bmatrix} e^{i \frac{\alpha}{2}} & 0 \\ 0 & e^{i \frac{\alpha}{2}} \end{bmatrix} \begin{bmatrix} e^{-i \frac{\theta}{2}} & 0 \\ 0 & e^{i \frac{\theta}{2}} \end{bmatrix} = \begin{bmatrix} e^{-i(\theta-\alpha)/2} & 0 \\ 0 & e^{i(\theta+\alpha)/2} \end{bmatrix}$$
where, for $\alpha = \theta$,
$$ \begin{bmatrix} e^{-i(\theta-\theta)/2} & 0 \\ 0 & e^{i(\theta+\theta)/2} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \theta} \end{bmatrix}. $$
If we were to use $ \alpha = \theta = \pi / 4 $ we would have
$$ \begin{bmatrix} e^{i \frac{\pi}{8}} & 0 \\ 0 & e^{i \frac{\pi}{8}} \end{bmatrix} \begin{bmatrix} e^{-i \frac{\pi}{8}} & 0 \\ 0 & e^{i \frac{\pi}{8}} \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & e^{i \frac{\pi}{4}} \end{bmatrix} $$
which you will recognize as the definition of the $T$ gate. This type of phase/rotation decomposition is universal. In fact, any arbitrary single-qubit unitary operator can be written in the form
$$ U = e^{i\alpha} R_{\hat{n}}(\theta) $$
for some real numbers $\alpha$ and $\theta$, and a real-three dimensional unit vector $\hat{n}$ (the same universal $U$ gate that you mentioned). To convince yourself this is true you can work through Nielsen and Chuang Exercise 4.8.