Why do the gas laws say gas cools as it compresses, yet when stars form, it heats up?
There are a few things going on in the formation of stars. First, let’s start with the ideal gas equation (at the temperatures described, the gases are far from ideal, but the relationships are still informative): PV = nRT As gas comes together, n increases, which will decrease the temperature. However, this does increase the gravity, which increases the pressure, which increases the temperature. If the pressure increases faster than the density, then the temperature will keep increasing until you get nuclear fusion. PS, the discrepancy between general relativity and quantum mechanics only really shows up on very small scales~10^-34 m, and really doesn’t have known applications yet.