2 Answers
2

Imagine a 1-D axis with a point that moves between two walls and bounces off them. With each collision it imparts momentum to the wall. Now imagine the walls will only accept a certain amount of momentum per unit time. If the point moves faster (increasing temperature) the walls will have no choice but to move further apart.

What I just described is effectively a constant pressure process of an ideal gas. For now, you can conceptually think of the "walls" as either the boundary of the gas, or neighboring molecules. The point on the number line (roughly) follows the ideal gas law.

$$ PV=nRT $$

This is one of, though not the only, state equation for a substance. The equation, as written above, has 4 independent variables (whereas $R$ is a universal constant). In order to reduce this, we will eliminate the macroscopic physical size, $V$ from the equation by division. It is then reformulated as a true state equation.

$$
\ P = \rho R_{\rm specific}T $$

Setting aside information about what type of gas you're dealing with, this equation has 3 unknowns. If you specify 2 properties, the last property is then set by physics. A state equation can be generally written as:

$$ {\ f(p,V,T) = 0}. $$

Expansion and compression due to changes in temperature is a subset of this relationship. Thus, your question is answered by the physics that give rise to the the relationship.

To the extent that we speak of the pressure of the wall, we are doing force balance which reflects Newton's third law and balance between the impulse of the molecules and the force on the walls is ultimately a consequence of $F=m a$ (Newton's second law).

For what you're asking about (solid thermal expansion), $P$ is the least important of the 3 variables. The state equation is mostly insensitive to pressure for solid materials, and the interplay between $T$ and $\rho$ forms the concept of thermal expansion. The other hairy detail of solids is that they're not free to move like an ideal gas, they're held together like springs. Indeed, it is difficult to convince oneself of solid or liquid thermal expansion (actually, sometimes the opposite happens in nature). If I have an object on a spring, then even if it moves with a greater energy/amplitude/average speed/temperature, its average position would remain in the same (equilibrium) position. Thus, we have to consider how chemical bonds are non-ideal springs.

To make this argument, the Lennard-Jones potential profile is sufficient. In this illustration I will illustrate the basic physical mechanism of thermal expansion of liquids and solids.

It's hard to quote a specific physical law, but from what I've argued here, I would say that the expansion of gases with temperature is largely explained by conservation of momentum and force distribution laws, while the expansion of solids is explained by the conservation of energy specific to real-world chemical potential profiles. Of course, the real state equation of real substances is probably somewhat of a combination of these two.

They are not necessarily related to conservation laws (or they are, but indirectly in the sense that energy is overall conserved, for instance when it flows from a hot to a cold source). The reason that an an objects tends to expand when heat flows into it is due to the fact that heat makes their molecules to move faster, so they put more pressure on the container when they collide with it, and make it expand (like a gas within a balloon, unless the container is rigid. The opposite happens when a gas is cooled