When people talk about fasting and "toxins" or "detoxification" it is a real and useful process, but it has to be done a particular way. Fasting does very, very little to detoxify the body, although if done right it may have other benefits.
The process of "detoxification" involves the liver. There are two steps, collectively called Phase 1 and Phase 2 detoxification. Phase 1 involves the Cytochrome P450 enzymatic reactions, a process generally known as biotransformation. To not get too complicated, something that is considered a toxin to the body, whether it was made by the body or came from outside of the body (through food, breathing, pharmaceuticals, etc) goes through phase 1 detoxification. This process creates a reactive site on the molecule. At this point, the molecule is a "reactive intermediate" and it is usually more toxic than the original compound, potentially doing cellular damage or affecting RNA or DNA.
The reactive intermediates from phase 1 detoxification need to be handled in phase 2. Phase 2 detoxification involves conjugation of the reactive intermediates with other molecular structures with the goal of neutralizing the deleterious effects of the intermediates from phase 1 on the body and allowing these compounds to be effectively and safely excreted in urine or feces without harming the GI/GU tracts. Phase 2 is a more difficult part of detoxification to manage because the molecules that are attached to the reactive intermediates are excreted, so a constant resupply of them (sulfur, methyl groups, etc) are needed.
Things to keep in mind is that phase 1 detoxification can be enhanced by doing almost anything to the body, particularly reducing caloric intake. It is not a process that is dependent on raw materials. This is why so many people feel like crap when they "detoxify" or fast. They THINK it's "the body getting rid of toxins" but in fact, the caloric reduction makes the cytochrome P450 process more efficient and the person is actually creating more and worse toxins for their body to have to deal with. And, since they aren't eating, or if they are it's lemonade and apple cider vinegar or whatever fad is big at the time, they aren't able to resupply the compounds lost during the phase 2 conjugation reactions, so the person is basically poisoning themselves, giving themselves diarrhea, headaches, joint pain, etc.
To truly "detoxify" the body one needs to eat particular foods that are high in things like sulfur, for example (although there are at least 6 different conjugation reactions, all requiring different raw materials), and plenty of calories so that the body can perform BOTH phase 1 AND phase 2 reactions. This can be done emphasizing organic vegetables and a little fruit while minimizing exposure to environmental pollutants, all the byproducts of meat, etc etc. This isn't necessarily the best thing longterm, but when done for 21-30 days, it has a very positive effect on the body.
This is FAR different from starving oneself, though, or doing some weirdo fad diet. I've done this several times myself and I actually eat MORE than I do when I'm just eating my regular diet. Average weight loss my patients have experienced doing this is in the 15 pound range, over 21 days, and that's eating 5-6 meals per day of veggies and some fruit, getting protein from whey or rice protein sources for the first 10 days, and then limiting protein to 12 ounces of lean and clean for the rest of the 21 days. No grains at all during this time, although I do allow for them to eat 1/2 cup of cooked rice/wild rice or 1 cup lentils.