A crucial concept to understand in this excellent short story is what is known as an "epiphany." In the collection of short stories of which this is a part, James Joyce creates characters that all have some form of epiphany, which can be defined as a sudden moment of insight or revelation when characters learn something about themselves and their place in the world. Let us consider how and why this change occurs in "Araby."
We are presented to a narrator who is shockingly Romantic. In his mind, he turns his trip to the bazaar into a quest for the holy grail. He transforms Mangan's sister into some kind of Arthurian lady and his life is dominated by his feverish imaginings. Consider the following quote:
These noises converged in a single sensation of life for me: I imagined that I bore my chalice safely through a throng of foes. Her name sprang to my lips at moments in strange prayers and praises which I myself did not understand. My eyes were often full of tears (I could not tell why) and at times a flood from my heart seemed to pour itself out into my bosom.
However, in spite of all his imagination, he cannot but be struck by the banal nature of the bazaar when he finally arrives there. It seems symbolic that he experiences his epiphany after the lights are turned out in the bazaar, perhaps symbolising how his childhood fantasies had been extinguished. Note what constitutes his epiphany:
Gazing up into the darkness I saw myself as a creature driven and derided by vanity; and my eyes burned with anguish and anger.
The boy realises how he has been seduced and compelled to act by vanity, and he realises just how illusory his dreams have been. As he cries wih "anguish and anger," we realise that he is growing up and leaving his childish and Romantic part behind.