Diets are restrictive, the reason they work is they restrict the calories you intake. However, with that restriction, much of the nutrition your body requires from food is eliminated as well. So ultimately, diets are not helping your body, but depriving of what it really needs to be healthy.
Most restrictive diets fail because they do not take into account a thing called life and lifestyle. Restrictive diets are followed for a certain amount of time and once a person comes off them, more than likely they will fall back into old habits, hence all the weight lost comes back and then some. Most of the current diets out there today, do not allow a person to learn and know what really is good and not good for them and how to make the choices and adjust their food intake so that they can maintain a healthy weight for their entire lives.
If you gradually reduce unhealthy foods from your diet and replace them with healthier options you will be able to maintain a healthy weight and stop the roller coaster ride of weight loss.