What is the difference between state and variable in react? [closed]

My question is more theoretical. So, I am wondering what is the difference between state and variable (const) in react? And also how does it impact rendering and DOM?

Because I can see that sometimes I can do the same task with both cases? Which one is better to use and when?