Lexical ambiguity is pervasive in language, and often systematic. For instance, the Spanish word "dedo" refers to both a toe and a finger, and this TOE-FINGER ambiguity is found in over 100 languages. Previous work shows that systematic ambiguities involve related meanings. This is attributed to cognitive pressure towards simplicity in language, as it makes lexicons easier to learn and use. The present study examines the interplay between this pressure and the competing pressure for languages to support accurate information transfer. We hypothesize that ambiguity follows a Goldilocks principle that balances the two pressures: meanings are more likely to attach to the same word when they are related to an optimal degree ---neither too much, nor too little. We find support for this principle in data from over 1200 languages and 1400 meanings. Our results thus suggest that universal forces shape the lexicons of natural languages.