Yes it comes from "context," but that's always true right? How the spoken language is understood is in a sense completely orthogonal to the written language for any language. E.g. the English spoken language has no way of distinguishing between the word "night" having two meanings, one being the opposite of "day," the other being a warrior and two words "night" and "knight." That is there is no real distinction between a single word with multiple meanings and multiple words with the same pronunciation at the spoken language level. Think about all the various definitions of the word "get" which also all require context to disambiguate in the spoken language even though there is no "written adornment."
That is to a large extent the "meaning" of the orthography is irrelevant to the spoken language.
I could come up with an alternative highly differentiating orthography for e.g. French without considering its spoken language either. I could mandate that "suis" as in "être" is not spelled "suis" but rather "swi" and "suis" as in "suivre" is still spelled "suis," but that has absolutely no impact on the spoken language. There is no difference to a speaker between a world where we have "swi" and "suis" and a world where we have two meanings of "suis."
Separately, it's also important to realize that Chinese characters don't always correspond to words in the same way that happens in English. From an English perspective, it is easier to think of Chinese characters in modern Mandarin as individual morphemes [0], e.g. stuff like prefixes and suffixes, that are also sometimes standalone words, rather than always entire words themselves.
So for example 誠 is not a standalone word in the same way "hono-" (e.g. "honesty," "honor," etc.) is not a standalone word in English, even though it is a recognizable prefix that means something.
So when spoken, speakers rely on a combination of audio and context cues to disambiguate the meaning and how word segmentation is supposed to be done (in the same way that English speakers both are able to distinguish between "knight" and "night" as well as "prototype" and the non-existent words "pro totype"). Note that this is subtly different from "disambiguating among characters." A less literate Chinese speaker might think that in fact 成, 誠, 城 are all a single character 成 that can be used in different ways when used as prefixes/suffixes in different words and we would have no way of knowing that without testing the speaker's writing capabilities.
Classical Chinese, the written, formal Chinese language from ~2500 years ago to ~100 years ago, however, where individual characters can almost always be used as standalone words, does present an interesting challenge when pronounced with a modern Mandarin pronunciation due to the high number of homophones in modern Mandarin (among characters but not words!). It can be very difficult to understand long tracts of Classical Chinese if it's spoken aloud using modern Mandarin.
This makes Classical Chinese essentially a written-only language. And in fact other systems for pronouncing Classical Chinese exist in countries that used it for writing but did not use Chinese for speaking (e.g. Japan, Vietnam, and Korea). This led to an interesting situation where literate individuals from those countries could communicate in writing with one another but not verbally.
[0]: This is a simplification. Despite many articles to the contrary, it is not true that all Chinese characters are morphemes. There are some rare cases of multi-character words whose constituent characters have no individual meaning and cannot be used outside of that single word.