If you are sitting all alone in the dining hall, there is no else with you in the room. You are the only person present, the sole occupant.
Loneliness, on the other hand, is a state of mind. When you say that you feel lonely, what it implies is that you feel unhappy because you don’t have any friends or anyone to talk to; you feel isolated. When you are in the company of people you are not alone, but you can be lonely. You might feel that you don’t really belong with the group of people. Since you have nothing in common with them, you cannot relate to them.
When people go abroad, they might be in the midst of a lot of people, but they still feel very lonely. On the other hand, people may be all alone, but they may not feel lonely.
*Thinking of his life back home made him feel extremely lonely.