The purpose of the socks would be to allow him to walk and be more mobile. He shouldn't wear them at night, as the pillow is a better solution there. The socks compress the veins while the elevated legs allow gravity to drain them.
I am not a doctor, nor do I play one on TV, but it seems to me that peripheral edema can be simply a more pronounced or visible form of a condition common to aging, and not necessarily even very old age. I don't have any signs of peripheral edema, but, for the past twenty years or longer, I have found relief in elevating my legs somewhat while sleeping, or even sitting, while I never considered the need to do that in my younger years. I didn't need to do that then because my job involved more activity, and my off-time was more recreational than leisure. Peripheral edema is a sign of something that is going on, and some of the causes can be a reason for concern. Unfortunately, many of them often accompany the aging process, particularly inactivity and some of the medications we might be taking. Obesity is another and, while that's certainly not specific to the aging process, it often accompanies inactivity. Of course, the most significant possible cause relates to heart failure, and the likelihood of that increases as we grow older, become sedate, and perhaps begin to gain weight. The possible causes too often complement one another, and not to our benefit.