CI platforms versus simple git hooks
The git hooks approach could probably work fine for lone developers. But when multiple developers work on the same project it doesn't work so well, especially in large scale projects.

Several reasons:


the git hooks are local to your copy of the repository, there is no check for consistency across all developers. Anyone can "adjust" their hook script as they see fit, or even forget to get them set up (they're not automatically installed when cloning git repositories for example). A CI platform will consistently run the same scripts for all changes.
the verifications performed are typically done on the developer's computer, so you're right into the typical "it worked for me" case. Again - consistency: a CI platform will perform the same verifications, in the same context, on a pool of resources much easier to keep consistent than developers' environments
the verifications performed by a developer are fundamentally silo'd, performed in isolation, on the local snapshot of the repository branch, before the changeset is actually integrated into the branch - they do not take into account the changes from the other developers which can happen at any time. Results obtained that way could be significantly misleading, see How can successfully pre-verified changes cause regressions which should have been caught?. CI platforms focus on the repository branch itself, checking how a particular changeset performs on that branch at that particular moment, with all other changesets already taken into account, reflecting the actual branch integration status.
(in larger projects) a CI tool can perform verifications which are impractical for the individual developers. For example multi-platform build lasting hours and requiring high performance build machines well above the typical developer laptop. The centralized verifications performed by a CI platform can be much more resource frugal than when performed by each individual developer.


Side note: not all projects benefit from the developer ability to spin up on demand a production-like environment/clone server ;) But even if possible, most of the above reasons still stand