DND is not a simulation game
The first thing to keep in mind is that DnD is not a simulation game. It contains many rule problems that break down if you try to apply them in a simulationist way.
The books I have reviewed do not discuss that question, but the surest assumption is that the conservation of mass and most of the rest of physics is effectively ignored, at least once the magic is involved. As an example, spells like enlarge definitely ignore all the implications of the square cube law.
The RAW response is that the spell does exactly what it says and nothing else.
Spells do exactly what they say they do, no more, no less. Enlarge, the many other effects that change shape, and in fact, all the spells I have reviewed do not say that they extract mass from other places, so they do not. The spell effect simply happens by magic.
Unless some book that I do not have contradicts me, I feel safe to say that the final rules in written response are that the whole explanation is "Magic." With nothing more or less.
Resignation: My access to books 5e is somewhat limited and, in particular, I have not read the 5e Dungeon Master guide. That said, based on the books I've read and the previous editions of which I've reviewed a lot of books, I think it's safe to say that DnD does not care about physics, especially when it comes to magic.