Minecraft wiki entry for Block_and_item_duplication, associated text: This method makes mass-duplication possible with the use of a shulker box and moving the contents of one duplicated box to the other, thus doubling how much you get each time, until you are duplicating an entire box's worth of items.
This does run the risk of massive lag in your world, by creating too many shulker boxes with contents. The effect may be even greater in online worlds such as realm servers. Be sure to transfer most items to regular chests after duplicating to avoid this.