A habit is often a response in response to a trigger,
which follows a routine,
and usually end with a reward.
This is called a habit loop. Because reward release dopamine (a neurotransmitter that makes our brain first happy and then hooked) we get hooked and the loop continues.
I believe Habit is one of the 3 things you need to increase productivity