The root of behavior starts in the brain. Yes, environments can shape, mold and influence behaviors but they are not the absolute direct cause of behaviors. If that were the case then people who smoke their first cigarette will never be able give up smoking for the rest of their life. People who quit smoking make a decision to quit smoking. Yes, sometimes with the help of a drug or therapy, but the ultimate root of behavior comes from the brain not the environment. If environments had the power to control our behavior then people would never quit smoking, stay in the same job and stay at the same weight for the rest of their lives.
If we understand what ultimately is the cause of behavior, we can then make sense of the reason (or one of the reasons) why changing habits can be so difficult.
It may not be that changing habits is inherently difficult but more so because we have been conditioned to think that they will be difficult, therefore causing it to be a difficult experience. Yes, there is the argument that we are at a biological disadvantage. That there are chemicals and mechanisms that the body deploys to make changing behavior difficult, that is true. But psychology can trump biology every single time... if we want it to. This means that some level of choice involved. Before you smoke the cigarette, before you overeat the junk food there is a window of opportunity where you have the ability to use your brain to consciously override those biological urges.
With that said we can now start to see how we may actually be making habit change harder than it has to be by believing that it is supposed to be hard. We hear things like "Losing weight is hard", "It's challenging for people to keep weight off", "Eating health is not easy". These thoughts can make habit change difficult if you do not use your window of opportunity to question them. Think psychology trumping biology.
Yes, the body can be conditioned to efficiently operate and crave the cigarette and the junk food making it harder to change, but, it can just as well be conditioned to crave the salad or the grass fed steak. You just need to understand that it may not be as to hard to change habits as you think it will be.