Fasting can be beneficial and harmful. I read if you fast for 3 days, your immune system resets which could be helpful if you have an auto-immune disease.
On the other hand, if you fast between 3 and 5 days, you can get a refeeding disorder where you can die from being reintroduced to food too quickly.
This happened to the survivors of concentration camps. When they were fed by allied soldiers, many of them collapsed and died.

Thank you