All the proper names of the Bible play a very important role in conveying God's message. Genesis 38 is a chapter where this general fact becomes specially true.
To understand the meaning of the scarlet hread on Zerach's hand I think it would be good to refer to all the names contained in the chapter.
The strange story of Yehudah's marriage and his first generations in Genesis 38 contains in fact many significant and interesting proper names that are also closely related to each other.
The very name of the father himself - Yehudah יְהוּדָה - to start with, which means "praised" or "thanked". The implied object of that praise is in fact the LORD (as clearly stated in Ge 29:35). The LORD is the One we thank as the source of every good gift we receive, and most importantly of our salvation.
The story begins when Yehudah, far from his brothers, through a friend from Adullam (the place's name probably meaning "justice of the people") whose name was Chirah ("whiteness, splendour"), meets a girl, whose name has remained untold. However, strangely enough, we know her father's name, instead, together with the origins of his family: he was a man from Canaan and his name was Shua' שׁוֹעַ. This name in Hebrew means "salvation", but it is not a name we find in Israel (elsewhere, it appears only as a Chaldean or Assyrian name, Ezek 23:23).
But the LORD didn't want Yehudah to have any offspring from a man with such a name: salvation's source must not remain anonimous and even the less it can't be identified with a sinful creature. In fact, the name Shua', not referring to the only true source of salvation, that is HaShem (לַיהוָה הַיְשׁוּעָה Ps 3:8), automatically becomes a lie, because it refers to somebody as something he can not possibly be.
Anyway, from the anonimous daughter of the carrier of that misleading name, we read that Yehudah got three sons. All of them with a significant name.
The first one he named 'Er עֵר. The two consonants of this name mean "awake", but this name turned out to signify the same as its anagram, i.e. the word that means "evil", ra' רַע. In fact Er was such a person in the eyes of the LORD (Ge 38:7). On this account, God put him to death.
Before that, anyway, Yehudah gave him a wife. It's quite interesting that her name (whose first meaning is "palm tree") refers, as a root, to the action of rising to the heights of the sky, like the palm trees do, and the pillars of smoke as well (Song of songs 3:6 כְּתִֽימֲרֹות עָשָׁן). Additionally the dates' palm trees refer to the sweetness of life and to the springs of living waters (cfr Exodus 15:27). Which corresponds very well to the role that Tamar is going to play in our story.
The following two names, of the second and third child, were given by the unnamed wife of Yehudah.
The second child, 'Onan אוֹנָן, means "vigorous", but that man didn't use his vigour to obey God's commandment and raise an offspring to his dead brother. Therefore the LORD put him to death too.
The name of the third one - Shelah שֵׁלָה , meaning "petition, request"- was also kind of prophetic, because he would be requested by his sister in law.
The birth of the two twins Yehudah got from Tamar, which repeats the story of Yitzchaq's and Yoseph's sons, brings up another pair of meaningful names after all the other names of the chgapter.
Again the one who looked like to be the firstborn became the second one, whereas the one to looked like to be the second one found his way out and became the firsborn. As for the first one, this action of breaking forth remains recorded in his name Peretz פֶּרֶץ. But the name of the second, Zerach ("shining") refers to the scarlet thread that was put on his wrist as a sign that he would be first.
Actually, that scarlet thread, shaniy שָׁנִי, is referred to by a word that has the very same consonants as the Hebrew word for "second" sheniy שֵּׁנִי.
In conclusion one of the main teaching we can draw from all these stories is that we must not rely on what we have and what we can see.
The root of the name Zerach (zayn + resh + chet) cconveys the meaning of "irradiate, come out, appear" and also echoes the meaning of the close root of zara' (zayn + resh + ayn) which means to sow. But he was not the seed, he only appeared so.
What happened to Zerach shows that situations can easily and quickly change (Proverbs 23:5). Those who were first can easily become the last ones if they take for granted what they have received and not make any effort to get it. The fact that salvation comes only from Ha-Shem, whom we cannot see, gives us the responsibility to keep searching for Him, together with the blessed hope that one day we will eventually encounter our King, whom we can't see now because everything we can see now is only for some time, whereas His kingdom will be for ever.
As always in the living Word of God, this general message can be found also in the details, like that one of the Hebrew word for the scarlet thread on Zerach's hand, that was meant to signify that he was the first but that also contained the meaning of being second.