Git stores every change (a commit): who changed what, and when. You can return to any earlier version, and several people can work at once on separate branches.
Git holds not only application code but also infrastructure files (e.g. docker-compose.yml, Nginx configuration). GitLab and GitHub are hosting platforms for Git repositories that also run CI/CD.
Example
A mistake slipped into a server configuration — Git history shows what changed, and the previous version is restored in minutes.