When invitations were hand written, the names of guests were written as part of the invitations themselves and hand delivered by a footman. If the footman didn’t know the home he was to deliver the invitation, detailed directions to the guest’s home were written on the outside envelope. Or, if you didn’t have a footman, invitations were put into envelopes and the address of delivery was written on the front envelope and was delivered by the post.
Households typically contained extended families and when the invitation was delivered, the outer envelope was removed and the household members invited to the event was written on the front of an inner envelope. To prevent snooping, the inner envelope was often sealed by wax so only the invited guests would see the envelope contents.
So, the purpose of two envelopes is that the outer envelope detailed whose household the invitation was going to and directions for delivery and the inner envelope stated who in the household was actually invited to the event.