The arrival of the demon lord Juiblex in the Underdark somehow granted Glabbagool sentience. It wanted to avoid fighting, however, and was genuinely curious about the world and the people that inhabited it.
Glabbagool was a gelatinous cube in the Silken Paths. When Juiblex arrived in the Underdark, it was granted sentience. It may have met and befriended a party of adventurers escaping the drow slavers of Velkynvelve, even offering to travel with them or gift them a magical mace located within its oozing form.