It's not necessarily quantum. You consider a many-body system and realize that quite often the "macroscopically relevant" degrees of freedom change significantly over much larger spatial and temporal dimensions than the much more fluctuating microscopic ones. Thus you can simply average over "macroscopic small but microscopic large" spatial and/or temporal regions.
Now to consider the reaction of the matter to some external electromagnetic field or, equivalently, the presence of some external charges and currents you can lump some parts of the equation either to the "fields" or the "matter".
E.g., considering a dielectric you usually think in terms of charges bound within atoms and/or molecules making up your macroscopic matter and usually you describe (in linear response approximation) the result of the action of the external em. field in terms of the polarization ##\vec{P}(t,\vec{x})##. You can, however, equivalently also put it into effective charge and current sources, ##\rho_{\text{pol}}=-\vec{\nabla} \cdot \vec{P}## and ##\vec{j}_{\text{pol}}=\partial_t \vec{P}##.
Now you can write the inhomogeneous Maxwell equations in the form (in Heaviside-Lorentz units)
$$\vec{\nabla} \cdot \vec{E}=\rho_{\text{pol}}+\rho_{\text{ext}}, \quad \vec{\nabla} \times \vec{B}-\frac{1}{c} \partial_t \vec{E}=\frac{1}{c} (\vec{j}_{\text{pol}} + \vec{j}_{\text{ext}}).$$
Another, more common way is to use ##\vec{P}## instead. Then you have
$$\vec{\nabla} \cdot (\vec{E}+\vec{P})=\vec{\nabla} \cdot \vec{D}=\rho_{\text{ext}}$$
and
$$\vec{\nabla} \times \vec{B} - \frac{1}{c} \partial_t \vec{D}=\frac{1}{c} \vec{j}_{\text{ext}}.$$
So you can shuffle parts of the "matter part" of the equations to the "field part" and vice versa.
The same is of course true for the magnetic "field and matter parts". Which leads to the introduction of ##\vec{H}## lumping parts of the "atomic currents" and the "elementary magnetization" to the fields. Also the magnetization can be counted into the currents. So you get many ways to formulate "macroscopic electrodynamics" in differently doing this split into a field and a matter part. At the end you should of course get the same result for the observable quantities.
What you of course also need then are the constitutive relations, as in linear-response approximation, ##\vec{P}=\chi_e \vec{E}## (or equivalently ##\vec{D}=\epsilon \vec{E}##, ##\epsilon=1+\chi_e##) and (unfortunately for historical reasons in a sense inconsistent convention) ##\vec{M}=\chi_m \vec{H}## and ##\vec{B}=\vec{H}+\vec{M}=\mu \vec{H}, \quad \mu=1+\chi_m##.
Of course this more or less naive classical picture has its limitations (particularly for the magnetic part), but qualitatively it's not so bad to have this picture in mind. A very nice discussion can be found in the Feynman lectures:
https://www.feynmanlectures.caltech.edu/II_32.html
and the following sections.