What are totafos?
וקשרתם לאות על ידך והיו לטטפת בין עיניך
You shall bind [these words] as a sign on your arm, and they shall be totafos between your eyes
The Torah when it describes the mitzvah of tefillin describes them as being a sign on your arm and as totafos between your eyes. The word totafos is hard to translate. Menachem Ibn Seruk, a tenth-century Spanish-Jewish philologist often quoted by Rashi, relates it to the verse והטף אל דרום, and speak to the south. This verse tells us that the word totafos connotes speech. Tefillin are meant to be understood as a reminder: that people will see the tefillin on a person’s head, remember the miracles of Egypt and begin to speak about them. This is because two of the parshiyos, paragraphs, written in the tefillin discuss the Exodus from Egypt. In a simpler fashion, Ramban writes that totafos is just the name that the Torah gave to the head tefillin.
Rashi cites from Chazal a more technical explanation. The word totafos is actually a contraction of two words from two foreign languages. “Tat” in Katpi means two, and “Pas” in Afriki means two. Put them both together you get four, which is an allusion to the four parshiyos written in the tefillin. This begs the question: why did the Torah write the word for tefillin this way? What is being conveyed by splitting the four parshiyos into two groups?
The reason is simple. Even though there are four parshiyos in tefillin, there are two main ideas to be found in them: belief in the Oneness of G-d, and recalling the miracles of the Exodus from Egypt. The Ramban explains the purpose of tefillin is to engrain these ideas into ourselves. The arm tefillin are bound next to the heart, the seat of the emotions, and the head tefillin are bound on top of the brain, the seat of the intellect. The first two parshiyos of kadesh and vehaya ki yeviacha in the tefillin discuss the miracles that Hashem performed for us as He took us out of Egypt. The last two parshiyos of shema and vehaya im shamoah discuss the unity of Hashem and the reward and punishments for keeping His mitzvos. These two ideas are the cornerstone of our faith, and by putting them in our tefillin we will remember them always.
This explains why the Torah alludes to the number of parshiyos in tefillin using two words; to allude to the two ideas found in them. It also explains the prayer found in most siddurim which is recited right before donning the tefillin. It discusses the four parshiyos of shema, vehaya im shamoah, kadesh, and vehaya ki yeviacha. It also discusses the two ideas found in the tefillin, the Oneness and unity of Hashem, and remembering the miracles of the Exodus from Egypt. One thing that doesn’t add up though, is this prayer lists the parshiyos in the wrong order. Chronologically the last two parshiyos listed occurred earlier in the Torah than the first two listed. Why was this prayer formulated this way?
According to the idea we wrote above, everything makes sense. There are two main ideas found in the tefillin, belief in the unity of Hashem and recalling the miracles of the Exodus from Egypt. The logical first choice of the two is the belief in the unity of Hashem. This is the foundation of our faith. Therefore, the parshiyos which discuss that idea are mentioned first in the prayer. The miracles of the Exodus are second in importance, and therefore its relevant parshiyos are mentioned second. Since this prayer was formulated to help remind us of the purpose of tefillin, it now makes sense why it was arranged in this order.
 Based on Be’er Yosef to Deuteronomy 6:8
 Deuteronomy loc. cit.
 See Targum Onkelos who translates totafos as tefillin, which is actually an Aramaic word
 See Rabbeinu Bachaye to Exodus 13:16 who explains why the Torah first calls tefillin a sign, then calls them something else
 In this instance Rashi quotes him in his commentary to Exodus loc. cit.
 Ezekiel 21:2. He gives another example from Micah 2:6. Ibn Ezra to Exodus loc. cit. writes that totafos do imply remembering, but he finds the citation Menachem used from Ezekiel to be farfetched
 In truth Exodus 13:9 refers to the head tefillin specifically as a reminder, so it could be revealing to us the meaning of totafos
 Rashi loc. cit.
 ad. loc.
 to Exodus loc. cit. and to Deuteronomy loc. cit., quoting Sanhedrin 4b
 Be’er Mayim Chaim, by the brother of the Maharal, to Deuteronomy loc. cit. explains that Chazal had a tradition that these two words actually originate from before the story of the Tower of Bavel (Genesis Chapter 11). Back then everyone spoke loshon hakodesh, Hebrew. After the dispersion and the creation of new languages, these two words remained and were used by the people who spoke Katpi and Afriki.
 to Exodus 13:16
 The halacha brought down in the Shulchan Aruch Orach Chaim 25:5 is to have these ideas in mind when donning the tefillin
 The parshiyos in our head tefillin are placed according to the opinion of Rashi, chronologically as they appear in the Torah, placed left to right from the perspective of the wearer (Shulchan Aruch Orach Chaim 34:1). There are three other opinions of how to place the parshiyos, the most famous of which is according to the opinion of Rabbeinu Tam. The other two opinions are the order decided by Rashi and Rabbeinu Tam but going in the opposite direction, right to left. However, the order that appears in this prayer doesn’t correspond to any of these four opinions, which strengthens the question why does it mention them this way