The heading over a composition in the Guru Granth Sahib is a compact technical instruction, and reading it is a skill in itself.
It gives the measure, sometimes with a named variant. It gives the author by number where the author is a Guru, and by name where the author is one of the bhagats. It frequently gives the form, so that the reader knows whether what follows is a short hymn, an eight-stanza composition, an extended lyric, or a ballad. Where several compositions of the same kind stand together it may number them. In the case of some of the vars it names the tune, by pointing at an existing ballad the audience would have known, which is the closest the volume comes to notation.
None of this is decorative and none of it is later editorial apparatus in the ordinary sense. The headings are part of the transmitted text, they are consistent across the volume, and they are consistent enough that irregularities in them are studied as evidence about the compilation.
For anyone using the Granth as a source, the headings are also where most of the hard information is. The compositions themselves rarely date or place themselves, and almost never name an occasion. The heading is what allows a hymn to be attributed, located in the arrangement and performed, and a reader who skips the heading in favour of the verse has skipped the part that makes the verse usable.