The mitochondria of the cell receives the message there is no food and it triggers self eating (a mechanism called Autophagy). The mitochondria then eats up dead, old diseased, inflamed parts of the cell as well as old proteins i.e. it removes all the cellular waste and uses it to create energy.
At the same time it finds our supplies of stored fat and also uses that as fuel which enables us to lose weight. We support the cellular detox and cellular repair by flushing out the toxins by drinking lots of pure water. There is strong evidence for the beneficial use of autophagy. The 2016 Nobel prize was awarded to Yoshinori Ohsumi for his discovery of autophagy.