Hieroglyphic systems like Ancient Egyptian work on a combination of phonetic and semantic (meaning-based) principles. To write a word like "penis" or "dog" you will write several symbols, some indicating the sound, and some indicating the meaning. This is still how it works today in languages that use Chinese characters. A Chinese character like 液 yè "liquid" has two parts: the first part to the left (the three dots) indicates that the meaning has something to do with water. The part to the right is phonetic and means that the word is pronounced similarly to the other word 夜 yè "night" (which character can itself be broken down into semantic and phonetic parts). In the Egyptian examples you linked, the phonetic parts are followed by a semantic part.
Furthermore, in ancient systems, there's some nondeterminism in how you can write: you can write a word using only the meaning element, or only the sound elements, or a combination of both, depending on how you feel, how much space you have, etc. You see the same kind of thing in Mayan hieroglyphics and in Chinese writing before it was standardized by Li Si in the Qin dynasty.
This kind of system is useful because, by complementing the phonetic writing with semantic symbols, you can disambiguate homophones and maybe make reading faster. But I don't think this functional reason is why systems like this emerged: usually writing systems start off fully semantic and then acquire phonetic parts as time goes on. Semantic writing seems to be the "default" somehow, if you have writing at all, and phonetic writing is something that people have to figure out over hundreds of years of cultural evolution.