Terraform manages the resources it knows about in the code & in the state file.
To add resources into the state file you’d use
terraform import for existing resources or write code and run
terraform apply for new ones.
Once you set Terraform to control a resource it is important not to also manage the resource in a different way - any changes from elsewhere would be reverted if the resource is managed by Terraform, and would be ignored if the resource isn’t. So creating a new team permission outside of Terraform wouldn’t be known about, as it isn’t in the Terraform state unless you run
github_team_repository resource doesn’t change the repository itself, so it is safe to use without worry about destroying the repository itself.