It has a lot to do with motivation and determination to become successful in life.
Some people are also functional out of fear of failure, so they keep on going.
It's also a way in which you develop your way of controlling your body, into a way of controlling everything around you and you want not only your calorie intake or your body to be perfect, but also your grades/eucation/work and all the rest. There comes a time when you're so used to your ED that you don't mind living with it, as long as everything else in your life is on track. You start using it as something that can help you make plans and follow them strictly, and yes, it may be stressful, but it's in my opinion the best part of my life.
I used to be like that in high school. Straight A student, making plans and actually sticking to them, exercising on a daily basis, keeping track on not only what I eat, but what I do outside of my ED, but once I was accepted into university, my life turned upside down. I allowed my ED to take control of me once again and I simply... let myself go. I am currently at rock bottom, even below that, I've never been so low in my life. How did I turn from a high functioning achiever to a low life prisoner of my own ED? Well, major depression.
I thought the term "crippling depression" was just an old dank meme, until I actually got to experience it. It didn't happen all of the sudden, mind you. I was dealing with depression probably alongside my ED, but never knew it would become so bad until the second year of university when the material I studied became harder for me to memorize and low restriction made me more fatigued and tired, which resulted in oversleeping, lack of motivation, procrastination (the worst that could ever happen), skipping lectures, and thus resulting in failed exams and even more lack of motivation, to the point where I don't even feel motivated to step out of bed, because I don't see any point of doing anything. I've never been so low in my life. I read all those comments of people being successful at what they're doing. which makes me question What am I doing with my life then?! and this adds even more to my depression. Why can't I bring that past me back? I would do literally anything to have that motivation again and work on my education, not just my body. Now I feel even more worthless and useless.