By default, you can scroll inactive windows when you hover your mouse over them.
If you don’t want this feature, then you can turn it off and here’s how:
Open the Settings app (press Windows and I keys simultaneously for that).
Hit Devices > Mouse.
Click on the toggle switch beneath Scroll inactive windows when I hover over them.
Note: if you want to enable this feature, follow the above steps.