Santhara or Sallekhana is the Jain practice of peacefully embracing the evident end of life by gradually reducing the intake in order to purify 'body and mind'. In short it is the Jain practice of facing death voluntarily at the end of one's life by fasting which is prescribed both for the householder and ascetics.
Logical Explanation
The practice of Santhara can be understood by a simple example. Suppose your house is engulfed by fierce fire. What is the suitable thing to do: (a) To pour water and delay the unavoidable OR ( b) Take away the valuable and important things from that burning house. Human body is like a house and death is like a fire in this example. You can delay the inevitable, i.e. death, but cannot escape it. Accumulating good deeds by renouncing pleasures (including food, water), meditating, controlling all his passions, abandoning all worldly attachments, observing austerities and embracing death on his/ her own terms is akin to taking your important/ valuable things from your burning house.
Why it is not Suicide
Santhara is often compared with suicide. According to the Jain text, Purushartha Siddhyupaya, when death is near, the vow of Santhara is observed by properly thinning the body and the passions. It also mentions that, Santhara is not suicide since the person observing it, is devoid of all passions like attachment. Like most religions, Jainism forbids all forms of suicides. Suicide involves an intentional act of harm against oneself with a known outcome that negatively affects those left behind.