Does purging contribute to being underweight or just maintaining?

Can be either. Weight ultimately is the result of calories in vs. Calories out. Purging (vomiting or laxitvie abuse) or even intense exercise compensates for the massive calorie overload that can occur with binging. Some maintain normal weight that way; others develop what is called buliarexia, where they are binging but become markedly underweight with distorted body image like anorexics.
Can cause gain too. While many people with an eating disorder believe it will help them lose or maintain weight, purging can also (and often does) lead to weight gain through several mechanisms, especially to a disruption of the body's metabolism as well as significant increases in the body's production of cortisol. When patients who purge begin to gain weight, their desperation reaches new highs.