Sleeping tablets work by closing down part of your brain. If you use them for too long that part remains closed, or doesn't fully reopen.
Once you come off them that part of your brain opens up again, meaning you feel clearer.
Sleeping pills should be a short term thing, not long term.