Entirely different creatures united conquered under a common faith.
Volo's Guide to Monsters has some info on this in the section Goblinoids: The Conquering Host:
Maglubiyet is truly the Conquering God. He stiffens the spines of cowardly goblins. He rouses bugbears from their lazy slumber. He sets the thunderous step of hobgoblin legions. Maglubiyet takes three races and turns them into one people.
In bygone times the goblinoids were distinct from one another, with separate faiths and different customs. Then Maglubiyet came and conquered all who stood before him, mortals and deities alike. Gods and heroes who wouldn’t bend to his will were broken and discarded. He put his foot on the neck of mighty Khurgorbaeyag, bound the will of intractable Hruggek, and forced sadistic Nomog-Geaya to fall in line. What the goblins, the bugbears, and the hobgoblins were before their gods bowed to Maglubiyet no longer matters. Now they are, first of all, followers of Maglubiyet.
On the surface, goblins, bugbears, and hobgoblins are as different as halflings, dwarves, and elves. Each race has its own tendencies, outlook, culture, and gods. But Maglubiyet’s hand joins them together, just as he made all their other gods parts within a greater whole. When one kind of goblinoid encounters another kind, the two groups don’t see one another as strangers or foes. Instead they know that by the fact of their meeting alone, Maglubiyet has commanded them to come together. They know the time has come to form a host.
Volo's Guide later goes more in depth in the nature of their relationships:
The goblinoids are bound together by Maglubiyet’s subjugation of their individual deities. All types rightly fear Maglubiyet’s wrath, but each carries out the Mighty One’s divine will differently. Goblins typically flee from obvious threats, and hobgoblins often have to round up and threaten them before they can make use of them. Bugbears accept hobgoblin demands for assistance only grudgingly, and often they must be bribed with loot, spirits, battle gear, or the severed heads of enemy leaders — a particularly holy gift. Hobgoblins operating on their own will remain in their forts, content to deal with internal politics of rank and matters of defense, but when they encounter other types of goblinoids (or seek them out), it is viewed by all as a divine sign — Maglubiyet has called them together to do his bidding on a grand scale.
Volo's Guide has extensive details about these races that should provide ample background info for worldbuilding purposes.