So rats have a built in gene sequencer and detect the base pairs directly?
And the researchers can be taking drugs changing their smell, possibly changing the mice behaviour.
As for why rats may develop the ability to sequence XX vs XY - if rats with the ability to do so were killed far less than those without, then rats would quickly evolve the ability to do so. This could happen if males were the ones killing rats and not females. Actually, skip the 'probably not' I began with - it's a perfectly likely explanation that may or may not be true based on further study.