How does google understand the legitimacy of a website by user activity? Apart from:
- total time spend on a particular webpage by users
- total clicks on the website by users
- total unique visitors
They don't. They don't know that information unless you're using Google Analytics and they have already stated that they don't use Google Analytics' data in their ranking algorithm.
The closest thing you may find them using is click through rates on their site and time spent on a site before returning back to Google. There's been no official word on this but many SEOers like to speculate that these are actually ranking factors.