If a person is “pining away,” he or she is tormented by longing or grief, because pine, in this case, has the same meaning as pain.
In the early English language, Christians referred to pinian as the consequence of the tortures and punishment of Hell.
Pinian became both pine and pain.
As time went on, pine acquired a softer meaning, more associated with Purgatory, that suggested languishing or wasting away, while pain retained its “hellish” origins.
Today pine usually has a romantic context such as “pining” for a lost love.
We often say that someone grieving is “pining”.