You have an unconscious and conscious mind. Your unconscious mind is the one that drives your life. That does everything you don’t think about. And the conscious mind is the part of your mind that think, and makes choices, and decides what it is you do and don’t want to do. The Problem is that your unconscious mind will take over when you are not consciously thinking about it.
What hypnosis does is goes in through the “back door” of your mind and helps your unconscious mind changes its beliefs, patterns and habits so that when you are not consciously thinking about quitting, it takes over and works for you to be a non-smoker.