In short, addiction works in the following way:
You do something that causes your brain to feel dopamine and other neurotransmitters and hormones.
These make you feel amazing.
Then you continue to do the behaviour, so your brain continues to release these neurochemicals.
But over time your brain builds up a tolerance to these neurochemicals.
Meaning that you need to do the behaviour more to get the same effect.