Cranberries are sharply acidic and rich in proanthocyanidins — compounds best known for stopping bacteria adhering to the wall of the bladder. The same anti-adhesive property is what makes them interesting for skin: fungi and bacteria that cannot grip cannot establish.
On feet the practical mechanism is largely the acidity. Fungal species that cause athlete's foot and nail infection prefer a neutral to slightly alkaline surface, and an acidic soak makes the skin an inhospitable place for them.
Use unsweetened juice. Sweetened cranberry drink is mostly sugar, and sugar is food for exactly the organisms you are trying to discourage.


