The most common and most secure variant is the Authorization Code flow. There are four parties: the resource owner (you), the client (the app asking for access), the authorization server (Google's login system), and the resource server (the Google API holding your data).
It runs roughly like this. The app redirects your browser to the authorization server with its client ID and the scopes it wants. You log in and see a consent screen listing those scopes. If you approve, the authorization server redirects back to the app with a short-lived authorization code in the URL. The app then makes a server-to-server call, swapping that code plus its client secret for an access token. It uses the access token in the Authorization header on every API request.
Access tokens are deliberately short-lived, often 1 hour, so a leaked token expires fast. To avoid forcing the user to log in again, the server also issues a refresh token, which the app exchanges quietly for new access tokens. For mobile and single-page apps that cannot keep a client secret private, you add PKCE (Proof Key for Code Exchange, RFC 7636), which ties the code exchange to a one-time secret the app generates, blocking attackers who intercept the code.