Terraform state files are a representation of the world. They contains all information about every resource created, sensitive information (for example passwords). It can be stored in a database or you can use a paid Terraform Cloud service to do it for you.
Related
How to create Remote Backend with S3 and DynamoDB with Terraform