Why would one use "enter the name of the project to confirm"?

If you're a long-time GitHub user, you probably have seen something like this:

This happens every time you do a potentially destructive thing to a repository, like switching its public / private status or archiving / deleting it.

The prompt shows up in a modal after clicking the action button, so this is an extra measure to prevent accidental actions.

But as far as I am concerned, this is either ineffective in "setting another barrier" or too cumbersome as "an extra confirmation". One can simply copy the repository name from the URL or right above the input box (the bold text above), but this is still more complex than just clicking an extra button.

In my opinion, an extra modal with a bright red button that does't respond to keyboard actions (like the Enter key) would suffice. One would have to move their mouse onto the bright red button to click it for an extra layer of caution. This is less cumbersome and the disability to simply hit the Enter key is both simple and effective.

Can anyone explain how this "enter project name" is a good UI design?