GitHub is a site that hosts git repositories and provides tooling around it (Actions for automation, Pull Requests/Forks for collaboration, etc).
Git is a version tracking tool. It’s meant to track a history of changes across a set of files. That history and files and config is known as a repository. You don’t need GitHub or any of these sites to use git.
Git has a lot of really fancy and/or almost magical functionality to manipulate said history, but at the simplest level, you can manage a git repo with a handful of commands.