Terraform - Input Value Precedence

Hi,
I have a query regarding one topic in terraform beginners course.
I wanted to understand the difference between auto.tfvars , .tfvars file and variables.tf file.
How to apply all these three files with some usecases.
Using variables in terraform lab

A variables.tf file is used to define the variables type and optionally set a default value .

A terraform.tfvars file is used to set the actual values of the variables.

Basically, the distinction between them is about declaration vs assignment.
Check also this article and this thread in stack overflow.

https://amazicworld.com/difference-between-variable-tf-and-variable-tfvars-in-terraform/

So, is variable.tf file and .auto.tfvars works same.

These two files are similar but are not the same. Syntactically speaking, the variables.tf file is used to define the variable’s type and optionally set a default value. A terraform. tfvars file is used to set the actual values of the variables.

In the file “variable.tf” we can describe about the variable like description/type and also we can assign a default value to it.

Where as in “terraform.tfvars”, we need to just mention a key/value pair. In terraform, “main.tf” file takes the input var from “terraform.tfvars” and in case if the input var is not present in “terraform.tfvars” then it will take the default value which is given in the “variable.tf” file. (i;e values in the terraform.tfvars will override the default values of the variable.tf file).