• git is a system that lets you track changes of your files on your computer. Git is mainly used for textual files, like computer program source codes. The beauty is that you can then send the changes over internet to your friends or even publish those updates to websites like github for others to comment on and see.
  • github is a website that lets people publicly share and collaborate on open source applications. It's the most popular one for this, but there are other options (like GitLab), even ones that you can run on your own (Gitea)
The way it works is developers are writing source codes on their computer. When they make some nice group of changes, they "commit" it with git app (still on their computer). Then they export this "commit" to github for other developers to review (the thing is confusingly called "PR" - Pull Request... since you are requesting that commit to be pulled into the main sourcecode branch) and then the maintainer of the project on github can apply the PR to the main branch and then release the new version of the project.
(obviously I'm simplifying some stuff and not being exactly precise here)