Although "it is forbidden to light a fire in all your dwellings on Shabbat", it was allowed to lite a fire on Shabbat in the Beit Hamikdash to offer a sacrifice, which is essentially cooking for the people.
The reason why we don't light a fire on Shabbat is to not activate Judgement.
For example, a fire could cause a burn, and since G-D rests on Shabbat, He doesn't want to be disturbed?...
...but obviously there was an exception for the Holy Temple's purpose...
Daily Zohar - Beshalach Day 5
Based on Zohar Shemot 63B
Rabbi Yehuda said: Every single day, the world is blessed from that supernal day, the seventh day [bina which is called the supernal Shabbat] for each and every one of the six [supernal]days [i.e. sefirot, from chesed to yesod, each sefira corresponding to one day of the workweek] are blessed from that which they receive from that supernal day [Shabbat which is the secret of bina]. And every day gives [to the lower world] from that blessing that it receives on its own day.
Therefore Moses said: "Let no man leave of it [the manna] till morning." What is the reason? Because one day does not borrow or give to another [for example, gevura does not borrow or give to chesed, etc.] Rather, each one reigns exclusively, alone in its day, because one day can not reign on the day of its neighbor.
Therefore, all these five days [the first 5 days of the week] reign on their respective days, and that which they provide that which they have received. The sixth day [related to yesod] contains more [since malchut depends upon it; Shabbat too relates to malchut], and this is as Rabbi Elazar said: It is written, "the sixth day," [HAShishi, with the definite article Hei, "The" (Gen. 1:31)] which is not written with the other days of Creation. But this is the way they explain it. "The sixth day" shows that the Queen is joined with it to prepare the table for the King. Therefore, it has [receives] two portions, one for the day itself and one for establishing the joy of the King with the Queen [to enable a sumptuous banquet in their honor].
That night is the joy of the Queen with the King and their uniting, and all the six days are blessed, each one on its own. Therefore, a person must prepare his table on Shabbat night so that blessings from above will dwell upon him, and a blessing is not present on an empty table. Therefore, scholars who know this secret, mate only on Friday nights.
BeRahamim LeHayyim: Why did the Ari and Chida include this in Hok LeYisrael?
While it may not seem like it down here, each day is special and different from the other. Certainly we may work 5 days, and then have a weekend that includes Shabbat. And a Monday is very different than a Friday [T.G.I.F!] The Zohar above reinforces the idea that all flows from the Holy Shabbat, an idea we learned last month on a Friday Zohar from Volume II, page 88.
How the week goes depends on the Shabbat, for all days receive from Her. And he who works to prepare for the Shabbat helps to have these blessings pour into the weekdays too. The night too is reserved for special marital unity, for as we partner with G‑d in creation, so too newly-made souls of the highest level are formed on that night.
What does this mean to you, and why is it being revealed right now?