The BOM will primarily look at the order of the items in the Scene Browser for the order of the items in the BOM list, but this can be controlled by a setting and reordered in different ways later. The Position order of the BOM also reflects the number shown in the Item Bubbles.