Cartonization is the process of using the dimensions of products in a given shipment (part of or related to an order) to predict the optimal packaging to use based on what is available.
Advanced WMS or fulfillment software like Shipedge can easily do this across shipments, millions of times a day if needed.