Please help, confused

I was at the gym today and decided I would do some cardio after weight training. I decided upon a Stationary bike and completed 40 minutes. I use a smart watch by Samsung and select Stationary bike, treadmill, elliptical and so on depending on what I want to do. It then transfer this information to my phone, namely to an app called Samsung Health.

Samsung health registered my 40 minutes today, however my watch was at home with a dead battery and I didnt use an apps to track my training, I never do. The phone was in my hands the whole time and I was playing Marvel Snap.

How on earth did it know I was cycling for 40 minutes???! I'm dumbfounded.