OAuth 2.0 (Open Authorization) is a standard for granting consented access to resources on behalf of a user, without ever sharing their password. It's an authorization protocol, not an authentication one: it grants access to resources, like an API or the user's data, it doesn't say who they are. For example, a photo app asks permission to read your 500 Google photos without knowing your password. It's like giving the valet a car key that only starts it, without the trunk key or your house key.
OAuth 2.0 defines 4 roles. The resource owner is the user who has the data and can grant access. The client is the app that wants access. The authorization server receives the client's request and, if the owner agrees, issues an access token. The resource server holds the data, validates the token and returns what was asked. It's like a private party: the host (owner) tells the door (authorization) to give you a wristband (token), and the bartender (resources) serves you if they see it.
OAuth 2.0 has 3 common disadvantages. It lacks built-in security features: each implementation has to add them. There's no standard implementation: each provider does it a bit differently. And there's no common set of scopes: «read contacts» is named differently in each service. It's like a power plug: the standard says what the idea is, but each country's plug is different.
The flow goes like this. The client asks the authorization server for authorization, sending its id and secret, the scopes and an address to send the answer back to. The server authenticates the client and checks the scopes. The user logs in and grants permission. The server redirects back to the client with an authorization code or an access token, and sometimes a refresh token. With the access token, the client asks the resource server for the data. It's like getting a guest badge at an office: you sign in, the employee confirms, reception gives you the badge and with it you get in.
Scopes say exactly what access is granted for, for example «read contacts» or «view calendar». Which scopes exist and which resources they point to is up to each resource server. The access token is the piece of data that represents the authorization to access on the user's behalf. A token with the «read photos» scope can't delete any. It's like a hotel key card: it opens your room and the gym, but not room 302.
OpenID Connect (OIDC) is a thin layer on top of OAuth 2.0 that adds login and profile data about who logged in. When an authorization server supports OIDC, it's called an identity provider (IdP), because it returns information about the user to the client. It's newer than OAuth, so it's less widely adopted. It's like adding a photo to the party wristband: besides «may enter», it says who you are.
OIDC defines 4 pieces. The relying party is the current app. The OpenID provider gives it a one-time code. The token endpoint receives that code and returns a token valid for 1 hour; the key difference from OAuth is that this token is a JWT (JSON Web Token), a signed JSON with user data. The UserInfo endpoint receives the token and returns information about the user. It's like trading a ticket number for an ID card with your photo: the card can be verified without calling anyone.