The Sages instituted numerous enactments concerning Shabbat in order to erect a protective fence around the Torah. They prohibited taking medication lest one grind up ingredients to produce them (below 28:4); they prohibited riding on animals and using trees so that none would come to break off a branch (below 19:7; 20:1); they prohibited setting aside terumot (priestly gifts) and ma’aser (tithes) because this resembles allocating the teruma and making the fruits usable (below 22:5); they prohibited playing musical instruments so that people would not come to fix their instruments (below 22:17); and they prohibited asking a non-Jew to do melakha for Jews (below 25:1). They also ruled that one may not benefit from a melakha that was performed on Shabbat in a forbidden manner (below 26:1).
The Sages also enacted other ordinances whose purpose is to preserve the spirit of Shabbat as a day of rest and holiness. They ordained that on Shabbat, one should not speak of mundane business matters, nor inspect one’s fields or factories. They established that one should not prepare for the upcoming weekdays on Shabbat (below 22:9-10; 22:15). They instituted that one should not walk quickly on Shabbat, as one does during the week (22:7), and that one refrain from measuring things in the way that one does during the week (22:6). They further decreed that all objects that have not been designated for Shabbat use are considered muktzeh and may not be moved. This is to prevent one from spending his time on Shabbat organizing his home or garage, thus rendering Shabbat like a weekday (below 23:1).
The rabbinic prohibitions of doing melakha with a shinui or together with another person are also based on these same two reasons: to ensure that people not mistakenly violate the melakha in the normal fashion and to preserve the spirit of Shabbat.
The Sages did not add prohibitions to those of the Torah on their own. The Torah itself commands us to institute safeguards, in the verse: “You shall keep My injunctions (u-shmartem et mishmarti)” (Vayikra 18:30), upon which the Sages comment: “Make a safeguard for My injunctions” (asu mishmeret le-mishmarti) (Yevamot 21a). The Torah also instructs the Sages to enact ordinances for the Jews in order to give expression to the Torah’s goals, as is written: “Ask your father, he will inform you; your elders, they will tell you” (Devarim 32:7). Furthermore, we are commanded to obey these ordinances, as is written: “You must not deviate from the verdict that they tell to you, either to the right or to the left” (ibid. 17:11; see Shabbat 23a). The reason for this is that the written Torah is eternal; it is meant only to delineate general principles. In order for us to be able to observe the Torah in practice, the Sages were commanded to establish a framework for its mitzvot by instituting safeguards and decrees based on the principles laid down in the written Torah.
So it is with regard to Shabbat. We are prohibited from doing melakha so that we rest and stop working, as it is written: “but on the seventh day, cease” (Shemot 34:21), and “You shall not do any melakha – you, your son or your daughter, your male or female slave, your ox or your ass, or any of you cattle, or the stranger in your settlements, so that your male and female slave may rest as you do.” (Devarim 5:14). If one were allowed to do all his work with a shinui, he would never “cease from labor,” and if he were allowed to move muktzeh items, he would never rest. In order to prevent this scenario, the Sages prohibited performing melakhot with a shinui and moving muktzeh items (See Ramban to Vayikra 23:24; MT 21:1 and 24:12).
The mandate to enact decrees was given to the Beit Din Ha-gadol (the high Jewish court that functioned in earlier times; the Sanhedrin), which was made up of 71 sages and held court near the Mishkan or Temple. This court was established by Moshe and continued to function until after the destruction of the Second Temple. All its members were ordained in an unbroken chain that stretched back to Moshe. The entire Jewish people is bound by the ordinances of this Beit Din, as the Torah states: “You shall act in accordance with what they tell you from the place that God shall choose, and scrupulously carry out whatever they instruct; you shall act in accordance with the Torah they instruct you and the sentence handed to you; you must not deviate from the verdict that they tell you either to the right or to the left” (Devarim 17:10-11).