Sometimes a tune takes its name from a dance. In that case the dance may or may not have been expressive of the title. Perhaps the Black Stripper comes into this category, no, idiot, not that sort of dance, shut up.
Some tunes are definitely sound poems- the Fox Chase is one- Gander in the Pratie Hole might have originally been performed on the pipes with a lot of goosey honking (though beware- today's tune of that title might not be the "original").
There are a lot of commemorative tune names- O'Farrel's Welcome to Limerick, the Repeal of the Union, the Bould Fenian, the Land League, the Metal Bridge, the New Road to Wherever etc. These may be renamed tunes- they often have other names, e.g. O'Farrel is often referred to as Housewives' Choice or An Fishfluke.
Some will have had music hall songs attached to them, bits of stage Oirishry, Father O'Flynn is probably in this category.
Others are named after the composer or populariser or someone who was particularly fond of it- Tom Billy's, Coleman's No. 2 (not named after a visit to the toilet), Creavey's etc. Still others
Some were certainly named after the circumstances of their composition- I've forgotten who it was that, one fine summer's day, sat down for a rest while cutting turf, and an idea of a tune came to him- worked out on the spot on the whistle from his pocket, it's still called the Bank of Turf.
Other tunes are simply whimsical- Upstairs in a Tent, Last Night's Fun, When Sick Is It tay You Want, though I think It Goes As Follies is actually mondegrenic, someone asked what tune was played, expecting the name, and the player replied "It goes as follows" with a bit of an accent, then proceeded to play it.
There may be reasons behind many of the other names, though as Brendan Breathsnatch pointed out, the same tune may have contradictory names, and the same name can be attached to several tunes of different characters. I understand that some of the names by which tunes are known today resulted from record labels being incorrectly printed.
Ciaran Carson's "Last Night's Fun" is absolutely required reading in this context.