Role of public and private key in OAuth 2.0

So i am trying to understand this:

I am not being able to know the difference and usage of

private key : Generated from running command : openssl genrsa -out private.key 2048 Whats the need of it?

public key : Generated from running command : openssl rsa -in private.key -pubout -out public.key Whats the need of it?

OAUTH2 encryption key : I read that it is stored in config .php file. But what was the need of it?

Apart from this I have got the understanding of client id and client password which are given by the authorization server to get access token which is then used to fetch the resources we want if I am not wrong. Thanks