I’d idly wondered all my life, but never bothered to look it up. Turns out there doesn’t seem to be one clear accepted origin of Boxing Day, but the general premise goes that on or before Christmas Day people would give gifts to people of the same social level or class. On what used to be the first weekday after Christmas, but is now the day after Christmas Day, upper social classes would, in some form, give gifts to those in lower classes — often a Christmas box. This might have been because they had worked for them during the year in one way or another, like giving a Christmas tip to the milkman, or simply as a gift, or because the lower classes were too busy serving the upper classes on Christmas Day and so couldn’t do the Christmas thing properly themselves.
As is often the case, the Snopes article about Boxing Day, has a useful synthesis.