I too have addressed that question and have wrestled with the hard answers. We do things cause they work, perhaps disfunctionally but on some level, at some point it made sense.
I know for me, overeating started as a strategy to keep myself safe from sexual advances. As part of my weight loss journey I have been working on these issues and on finding healthier ways to keep myself safe.
It also works as an excuse. I've never been an active person and have defined myself more as an intellectual than as a physical person. I have come to learn the two aren't mutually exclusive and my excuses don't really make any sense. I can't run a marathon but I can walk around (as long as my fibromyalgia isn't flaring up LOL), I can swim, I can play, I can dance and I don't need to rely on my fat excuse.
It also worked as an excuse to have SPACE. As women we are often taught to shrink, to accomodate and to be flexible. Staying fat has been one way to impose myself and say "here I am!"
In addition, eating worked as a way to not handle my emotions in a healthy way. I'm lonely? I eat. I'm angry. Eat. Sad? Eat. I'm frustrated, happy, tired... I eat. I have been learning how to reverse this trend and really listen to my body's cues. Hunger feels quite different from sadness now.
In an odd way, my weight has also been a way to be different, not one of the bunch. Obviously there are MUCH better ways to do this

.
I have lost some weight and I have a lot left to lose. These are issues I am dealing with in journaling, collaging, my online support group and my daily life. It always surprises me when I discover I'm falling back into old patterns without even realizing it. Being much more conscious about myself and my body has helped tremendously.
I have also started identifying the things that I have put off "until I'm thin," and enjoying them now. I like going to the beach, making love with my partner, hanging out with my friends, dancing, and making my happiness now. I don't need to wait until I'm thin to do that. That makes it less scary for me and takes some of the pressure off.
I'm looking forward to reaching all of my goals but I'm no longer defining myself as "good" or "bad" according to what the scale says. At least not on good days!
Good luck with your weight loss journey!
Leticia