The name, philologists say, comes from Joha, a shortened form of the surname of a Byzantine family from these parts; but the legend is prettier, and tells of a noblewoman travelling through who lost a precious necklace here, later found on the hill. The town believed the legend: on its coat of arms there is no dynasty, as there is on those of the neighbouring towns, but a chalice-shaped cup brimming with jewels and bordered with farming motifs, the portrait of a community that lived between poverty and wealth, between the workshop and the great estate. Until the nineteenth century it was called simply Gioia, and its people still call it Sciò.
On the hill stands the castle, which is really three castles one on top of another: the Byzantine fortified enclosure, the residence that the Norman Richard Seneschal made of it in the twelfth century, and the definitive arrangement ordered by Frederick II around 1230, on his return from the crusade, with a quadrangular courtyard and four corner towers. Two of them survive, and are called the De' Rossi tower and the Empress's tower. The town, though, is far older than its name: five kilometres away, at Monte Sannace, a settlement of the Peucetians from the seventh century before Christ is still being excavated. And there is a date Gioia does not forget: on the first of July 1920, in the Marzagaglia district, six farm labourers were killed, and the following day, in reprisal, three landowners. All around remain the woods of Macedonian oak, rare elsewhere, between the Murge and the saddle on which the town rests.