The desire to establish un-equivocally the identity of the composer of a piece of music has only become an issue in the last couple of hundred years. This means that for much music written before the 19th century, we cannot categorically say who wrote it or, indeed, whether any one person is responsible for the piece as we now know it. In the former category, we might label the composer as 'anonymous'; in the latter we might well refer to the music as 'traditional'. In effect this is to say that a piece of music, or more likely a melody, has been passed down from generation to generation in the manner of a tradition.
Often melodies or pieces of music can undergo changes as they travel through history with each succeeding generation choosing to adapt the tradition to fit more appropriately with the current social situation. With folk music, this is often an oral process that doesn't write down the music but retains it in the collective memory of a community. In this case, we have no way of reconstructing what the melody used to sound like. Often, though, the same melody will be remembered by two different communities, and remembered differently as time goes on. Eventually the two versions of the melody, having passed through many generations of variants, may eventually sound substantially different, though we can say that they derive from the same source. In the 20th century, composers like Vaughan Williams and Bartók wrote some of these down, anxious to preserve the repertoire before the folk tradition died out.
'Traditional' could also be applied to music that was composed by an un-identifiable individual. Where as 'anonymous' might be a more accurate way to describe its composer, the piece may well have entered our cultural language to the extent that its performance constitutes a tradition to be passed to succeeding generations. Certain Christmas carols perhaps fall under this bracket. Essentially, though, the word is a way of making music from a time when the individual was less important than the act of music-making itself, fit in with our composer-dominated view of music.