Because, if you want to buy both large boxes and small boxes, then: if you buy 1 1 box, then 96- 1 1*8=96-88=8, and there are 8 left, it will not work.
If you buy 10 box, then 96- 10*8=96-80= 16, 16 is not a multiple of 6.
If you buy 9 boxes, then 96-9*8=96-72=24=4*6, which means you can buy 4 small boxes.