How does Google know what apps I've installed if I login to gmail via browser?
The login to Gmail is the very same you use for Play Store – so in fact Google knows it's you. The browser sends a user-agent string, by default identifying your device (brand and model). The history of your activities in Google Play Store tell which apps you've installed in what versions on this device.

So yes, that would be an easy thing to do for Google. I cannot say if that's really happening (or if your guess of not using the native app triggering such message is what's done) – but it's technically possible.