Doxologies, short bursts of glory giving, are older than Christianity, and the early church inherited the habit from the synagogue. The Gloria Patri's particular history begins in the fourth century, when the wording of such formulas became doctrinally loaded. Older Christian doxologies had often run glory to the Father through the Son in the Holy Spirit, wording the Arian party could read as making the Son a mere instrument. The formula that gives glory to the Father and to the Son and to the Holy Spirit, with one preposition binding the three persons in one glory, asserted their equality every time it was sung, and writers of the period defended precisely that coordinated wording as the church's tradition.
The clause that follows in Western use, as it was in the beginning, is now, and ever shall be, world without end, answers the Arian slogan that there was a time when the Son was not, eternity built into a congregational refrain. The Eastern churches say the same first half but continue differently, both now and ever, and unto ages of ages, and the two halves together show what the Gloria Patri is, a creed compressed to a couplet, small enough to end a psalm and precise enough to end an argument.