Because they don't have exclusive control, unlike social media where you can't take your data and move it to another provider, you can just take your repo to whichever provider or self-hosted GitOps option you want.

Not only can you take it with you, every developer already has a local copy of the entire repository.

The real value IMHO of github is the issue tracker and the visual diff/display of PR changes.