Symbolism, Imagery, Allegory
You may have already heard Om being chanted—for example, it's a staple in most yoga classes. And there's a good reason for this: the concept of "Om" signifies the unity and perfection of the universe. Plus, it sounds super lovely.
Siddhartha’s periodic recognition of Om punctuates moments of awakening in his life and functions to further guide his reflection and spiritual growth. He first meditates on Om as a boy in his hometown; this helps him decide to leave town for further spiritual growth.
Later in the book, on the brink of his suicide, Siddhartha recalls Om and it soothes him, reminding him of his true objective:
Siddhartha was deeply shocked. So this was how things were with him, so doomed was he, so much he had lost his way and was forsaken by all knowledge, that he had been able to seek death, that this wish, this wish of a child, had been able to grow in him: to find rest by annihilating his body! What all agony of these recent times, all sobering realizations, all desperation had not brought about, this was brought on by this moment, when the Om entered his consciousness: he became aware of himself in his misery and in his error. Om! He spoke to himself: Om! and again he knew about Brahman, knew about the indestructibility of life, knew about all that is divine, which he had forgotten. (8.6)
Ultimately, when Siddhartha attains enlightenment, it is through a profound recognition of Om through meditation on the river.