Note that the derivative with respect to $\lambda$ in Landau is being taken at fixed entropy $S$. This means that the probability distribution is not changing. This will happen if the change is slow eneough that the quantum adiabatic theorem holds --- meaning that the system stays in the same quantum state.
When you include the change in ditribution this gives rise to the $TdS$ part of
$$
dU = T\,dS-P\, dV.
$$
For example, given a Hamiltonian $\hat H$ whose eigenstates $|n\rangle$ have energy $E_n$, the canonical ensemble assigns a probability
$$
\rho_n = \frac 1 Z e^{-\beta E_n}
$$
to the state $|n\rangle$.
Here $\beta=1/T$ and
$$
Z= \sum_n e^{-\beta E_n}={\rm tr}\left\{e^{-\beta H}\right\}
$$
is the partition function.
The thermodynamic internal energy $U$ is then
$$
U= \frac 1 Z \sum_nE_n e^{-\beta E_n}.
$$
For any probability distribution $\rho_n$, the associated entropy is defined to be
$$
S= - \sum_n \rho_n \ln \rho_n
$$
For the canonical distribution, this leads to
$$
S= \frac 1 Z \sum_n \left( \frac{E_n}{T} +\ln Z\right) e^{-\beta E_n}= \frac U T +\ln Z.
$$
A change in the distribution leads to a change in the entropy of
$$
\delta S = -\sum_n (\ln \rho_n) \delta \rho_n.
$$
Here we have use the fact that $\sum_n \rho_n=1$ implies that $\sum_n\delta \rho_n=0$.
Let the Hamiltonian depend on a parameter $\lambda$ (the system volume, for example). The energy levels $E_n(\lambda)$ then also depend on $\lambda$, and we use the symbol ``$P$'' to stand for the generic thermodynamic average
$$
P= -\left\langle \frac{ d\hat H}{d\lambda}\right\rangle \nonumber\\
=- \frac 1 Z \sum_n \left( \frac{d E_n}{d\lambda}\right) e^{-\beta E_n}.\nonumber
$$
Thus
$$
\delta U = \frac 1 Z \sum_n \left(\frac{d E_n}{d\lambda}\right)\, \delta \lambda e^{-\beta E_n} + \sum_n E_n\, \delta\left(\frac 1 Z e^{-\beta E_n}\right)\nonumber\\
= -P\, d\lambda + T \sum_n \left( \frac{E_n}{T} +\ln Z\right) \delta \left(\frac 1 Z e^{-\beta E_n}\right)\nonumber\\
= -P\, d\lambda + T \sum_n (-\ln \rho_n) \delta \rho_n\nonumber\\
= -P\, d\lambda +T dS.\nonumber
$$
In passing from the first line to the second, we are allowed to insert the ``$T\ln Z$'' because $\sum \delta\rho_n=0$.