The first time a visitor comes to your website or mobile app, Google Analytics creates a random unique id that is associated with the user’s device. Each unique id is considered a unique visitor. In each hit, this unique id is sent to Google Analytics. If a new id is detected, this means there is a new user. If Google Analytics sees that the id is an existing id in a hit, it will count the hit as a returning user. These ids can be reset or erased if the user clears the cache from their browser or uninstalls/re-installs the mobile app.