Lots of possibilities.
If some oil leaked into the combustion chamber, it could have helped out your compression if it's your rings that are bad.
If the car was cold when you tested the first time and warm the second, it could have helped the headgasket seal better.