Not coincidence.
Some powders are temperature compensated, but usually only for a single cartridge. For example, Varget is very temperature stable in the 308, but very unstable in the 223.
For powders not particularly well matched to their cartridge, or for powders that have no temperature compensation, the temperature of the powder almost does not matter. Nor does ambient temperature.
What matters is the temperature of the barrel, and the temperature of the brass and the metal in the projectile. Ambient temperature only matters because it influences these.
The mechanism is that the rate of transfer of heat energy between two bodies is proportional to their temperature difference. Cold steel, brass, and lead rob more heat energy from the propellant gas than hot ones do.