There is a mitzva to safeguard the matzot from becoming ḥametz, as the Torah states, “And you shall observe (u-shemartem) the matzot” (Shemot 12:17). This refers specifically to the matzot eaten on the Seder night in fulfillment of the mitzva, for the very next verse states, “in the evening you shall eat matzot.” The other matzot one eats on Pesaḥ are like any other food: they may be eaten as long as there is no concern that they contain ḥametz. However, we have been commanded to safeguard especially carefully the matza used for the mitzva on Seder night. This matza is called “shemura”.
Le-khatḥilah, the safeguarding of the matzot begins with the harvesting of the grain to be used for the matzot. Common practice is to harvest the wheat while it is still a bit moist, for if it were to dry out completely and then get drenched by rain, it would become ḥametz. Likewise, the wheat kernels must be stored where there is no concern that they will come into contact with water.
One may also fulfill the mitzva of eating shemura matza with matzot that were guarded from the time the wheat was milled into flour. As long as the wheat kernels showed no signs of becoming ḥametz and nothing has happened that would undermine the presumption that they are not ḥametz, one need not be concerned that they had become wet and became ḥametz. However, this is not the best kind of shemura matza, since it was guarded only from the time of milling.
Under extenuating circumstances, when no flour that has been guarded from the time of milling is available, one may use regular, store-bought flour and fulfill the mitzva by guarding the dough from the time of kneading (SA 453:4). Even where it is customary to rinse grains of wheat lightly before milling them, it is still permissible in extenuating circumstances to buy regular flour in the market, since a brief rinse is presumed not to be enough to cause the grains to become ḥametz. However, where it is customary to briefly soak the grains in water, one may not buy flour for matza in the market, since it is presumed to be ḥametz (MB 451:24). Therefore, in practice, one should not buy flour that is not certified kosher for Pesaḥ since the wheat is often soaked in water and may have become ḥametz.
In practice, today’s custom is to be scrupulous about shemura matza; matzot that have been guarded from the time of harvest are used to fulfill the mitzva of eating matza on the Seder night. The enhanced practice has taken root so thoroughly that people have come to call matza that has been guarded only from the time of milling “non-shemura matza,” even though it is considered shemura halakhically, and one may use it to fulfill the mitzva of eating matza.
Geonic responsa, cited by many Rishonim, state that if no wheat was guarded from the time of milling, be-di’avad one may purchase flour from the market. If the matza was guarded from the time of milling, one recites the berakha of “al akhilat matza” over it (BHL 453:4), because Ran and many other Rishonim explain that according to Rif and those who agree with him, guarding the matza from the time of harvest is merely the best way to fulfill the mitzva (“mitzva min ha-muvḥar”). According to Kaf Ha-ḥayim 482:1, under extenuating circumstances, one may even recite the berakha over matza that was only supervised from the time of kneading. It seems that most poskim concur that be-di’avad, guarding from the time of kneading suffices.
Tur and Beit Yosef state that according to Rif, Rabbeinu Yeruḥam, Ran, and Magid Mishneh, the need to guard the matza pertains only to the matza used to fulfill the mitzva on the first night of Pesaḥ. All other matza eaten on Pesaḥ need not be guarded (MB 453:21). (Although some maintain that one must be stringent and use shemura matza for the entire holiday, either because there is greater concern about matza, which is made of flour and water, or because they maintain that there is a mitzva to eat shemura matza all Pesaḥ; see below, section 5.) According to Baḥ and those who agree with him, the mitzva to guard the matza is rabbinic, and the rabbis merely supported their enactment using a verse from the Torah. However, according to most poskim, this mitzva is from the Torah. So states BHL 460:1 s.v. “ein”, citing Rashba, Pri Ḥadash, and other Rishonim and Aḥaronim.