Every rag section in the Guru Granth Sahib is arranged by the same internal rules, and knowing them is the difference between finding a composition and leafing through fourteen hundred pages.
First come the Gurus, in the order of the succession. Authorship is marked by a number rather than a name: a heading of Mahala 1 indicates the first Guru, Mahala 3 the third, and so on, with the compositions of Guru Tegh Bahadur, the ninth, inserted at their proper place in the sequence when the final recension was made. The Gurus did not sign their work with their own names, and the convention of the numbered heading is part of a deliberate presentation of the succession as a single voice in different bodies.
Then, within each Guru's portion, the material is grouped by form: the shorter hymns first, then the longer eight-stanza compositions, then the extended lyric pieces, and finally, where the section has one, the var, a ballad form in stanzas with couplets set before each.
Last come the bhagats, the devotional poets from outside the Sikh succession whose work Guru Arjan gathered into the volume.
The scheme is applied consistently enough that its exceptions are studied. Where a composition sits out of order, or where a section departs from the pattern, the departure is itself evidence about how the compilation was assembled, and manuscript scholars have used exactly those irregularities to argue about the stages of the canon.