I use Moto G 2nd generation mobile phone. That has a built-in app called "Moto Assist". After the recent update, it automatically detects my movement and switches to "Driving" mode when I'm travelling. But I surprise is, how does it come to know that I'm driving even when Location, GPS, WiFi and mobile internet were turned off.
Can anyone help me understanding this?
Your phone is using the accelerometer to detect that you're driving. This is similar to how your phone can detect a step count when you are walking. Its a simple low-level sensor, and doesn't require any of those additional services to detect a driving state.
What it can't do is determine where you are. It can only determine that you are likely driving.