I don’t know where it comes from but rather than bringing individual presents it seems to be the thing to bring sweets in from wherever someone has been. Birthdays are marked by the person whose birthday it is bringing cake/ treats in.