He fights in the first battle of Mag Tuired, when the Tuatha Dé take Ireland from the Fir Bolg. Under the reign of Bres, when the Tuatha Dé are reduced to servitude, Ogma is forced to carry firewood, but nonetheless is the only one of the Tuatha Dé who proves his athletic and martial prowess in contests before the king. When Bres is overthrown and Nuadu restored, Ogma is his champion. His position is threatened by the arrival of Lugh at the court, so Ogma challenges him by lifting and hurling a great flagstone, which normally required eighty oxen to move it, out of Tara, but Lugh answers the challenge by hurling it back. When Nuadu hands command of the Battle of Mag Tuired to Lugh, Ogma becomes Lugh's champion, and promises to repel the Fomorian king, Indech, and his bodyguard, and to defeat a third of the enemy. During the battle he finds Orna, the sword of the Fomorian king Tethra, which recounts the deeds done with it when unsheathed. During the battle Ogma and Indech fall in single combat, although there is some confusion in the texts as in Cath Maige Tuired Ogma, Lugh and the Dagda pursue the Fomorians after the battle to recover the harp of Uaitne, the Dagda's harper.
He often appears as a triad with Lugh and the Dagda, who are sometimes collectively known as the trí dée dána or three gods of skill, although that designation is elsewhere applied to other groups of characters. His father is Elatha and his mother is usually given as Ethliu, sometimes as Étaín. His sons include Delbaeth and Tuireann. He is said to have invented the Ogham alphabet, which is named after him.
Scholars of Celtic mythology have proposed that Ogma represents the vestiges of an ancient Celtic god. By virtue of his battle prowess and invention of Ogham, he is compared with Ogmios, a Gaulish deity associated with eloquence and equated with Herakles. J. A. MacCulloch compares Ogma's epithet grianainech (sun-face) with Lucian's description of the "smiling face" of Ogmios, and suggests Ogma's position as champion of the Tuatha Dé Danann may derive "from the primitive custom of rousing the warriors' emotions by eloquent speeches before a battle", although this is hardly supported by the texts. Scholars such Rudolf Thurneysen and Anton van Hamel dispute any link between Ogma and Ogmios.
A Proto-Indo-European root *og-mo– ‘furrow, track, incised line’ may be the origin of the stem of the name. In addition, Proto-Celtic had a causative verbal suffix *-ej– ~ *-īj-. A hypothetical Proto-Celtic *Ogm-īj-o-s therefore looks very much like an agent noun derived from a verb formed by the addition of this causative suffix to the stem *ogm-. This agent noun would therefore mean ‘furrow-maker, incisor’ and may have had a metaphorical sense of ‘impresser.’