The prince meets this guy as he’s wandering around on Earth. While the switchman has a tiny role in the book, he highlights for the prince (and for us readers) some other characteristics about those silly adults.
The switchman’s job is to guide railway trains onto and between different tracks. He tells the prince that people are always going from place to place, looking for things. He helps the prince arrive at the discovery that people are looking in the wrong places, and that they don’t even know what to look for. Because adults are always searching and hurrying, they seem incapable of enjoying the present. However, children are much wiser:
“Only children know what they are looking for,” said the little prince. “They waste their time over a rag doll and it becomes very important to them; and if anybody takes it away from them, they cry…”
“They are lucky,” the switchman said. (22.16)
Recalling his conversation with the switchman, the prince is inspired to tell the narrator something profound: “‘And yet what they [these people] are looking for could be found in one single rose, or in a little water” (25.16). The prince implies that this intangible thing these people are seeking could be satisfaction. They don’t see these small opportunities for satisfaction and keep hurtling forward blindly.