The melon could not fit on the hat because it was too small.
The melon could not fit on the hat because it was too big.
You can investigate this yourself at http://corpus.byu.edu/coca/ ; the first hundred results for "fit on" contain, by my eyeball estimate, more than 90 of the sense I describe, zero of the sense you insinuate, and a few spurious hits (such as "to spend as it sees fit on government services", "kept himself fit on a rowing machine", and my favorite, "I've worked with schools such as the Pratt Institute and FIT on developing eco-friendly vegan design programs").
There are six results, out of over 500 million words, for "fit it on", of which one matches your pattern. ("She passes it under the running tap and hikes her tank up to fit it [a strip of nylon] on around her rib cage")
https://en.wikipedia.org/wiki/Winograd_Schema_Challenge#Pitf...
or a similar kind of inference that could be considered easier than expected.
I'm not sure exactly what I would consider "knowledge about the world" in this setting. :-)
Situation 1: vell=table, glirp=dish. "It" refers to the vell.
Situation 2: vell=bolt, glirp=nut. "It" refers to the glirp.
Replace "on" with "in", and maybe there's less ambiguity.
Actually, in this example knowledge of the world (I'm interpreting this as referring to knowing the details of how "files" and "hard drives" relate to each other) is not necessary. The ambiguity disappears as soon as you know the meaning of "fit" -- fitting requires a large thing to contain a small thing. Therefore if something is too large, it must be the contained object, and if something is too small, it must be the container, and those roles are marked directly within the syntax of the sentence.
You can easily see this experimentally by asking people about sentences with nonsense words:
1. The glirp couldn't fit on the vell because it was too small.
2. The glirp couldn't fit on the vell because it was too big.
Then again, I see you've already noted that speakers who don't know what files or hard drives are should have no trouble with these sentences. Is the lexical meaning of "fit" "knowledge about the world" to you?