The next time a similar expression is encountered, the new semantics are compared with the previous mental model so it can be extended.
if our system here, which knows "in the box", now encounters "in the basket" and "in the room", it would gradually be able to generalize the argument of "in the" to the concept of container (and would eventually reject "in the banana", say).