Either they note the context of the preceding sentences or they infer the meaning in isolation by knowing certain rules about the real world in this case, that boxes are bigger than pens (writing instruments) but smaller than pens (playpens), and that bigger objects cannot fit inside smaller ones.
ECONOMIST: A gift of tongues