I’m not sure anyone actually knows. I think it’s one of those things that’s so old it’s passed into obscurity. There’s a few ideas floating around, but nothing confirmed.
Edit for those downvoting but not providing anything of any use: check the history section.
Possibly emerged from a triskelion, which exists as a motif across Europe and beyond, but especially in regions associated with Celts, morphing into legs for reasons unknown and a few meanings attributed long after the fact.
No one knows for sure but there is speculation it is to do with the recycling of wooden legs in the Manx war of independence due to a lack of trees on the island.