Kindling fire is only mentioned here in Ex 35 it is not mentioned in Exodus 20 probably because Exodus is more general. Elsewhere in the Bible certain types of work are specified:
The rabbis of the talmudic period formulated the rules governing the Sabbath in systematic fashion. They were guided by the close proximity in the Torah of the prohibition of work on the Sabbath and the instructions for building the Tabernacle.
Exod. 35:2–36:7; cf. 31:1–17; Lev. 19:30; 26:2. Shabbat. 49b.
in the Mishnah Shabbat 7:2 we see acts of work
The principal acts of labor (prohibited on the Sabbath) are forty less
one—viz.: Sowing, ploughing, reaping, binding into sheaves,
threshing, winnowing, fruit-cleaning, grinding, sifting, kneading,
baking, wool-shearing, bleaching, combing, dyeing, spinning, warping,
making two spindle-trees, weaving two threads, separating two threads
(in the warp), tying a knot, untying a knot, sewing on with two
stitches, tearing in order to sew together with two stitches, hunting
deer, slaughtering the same, skinning them, salting them, preparing
the hide, scraping the hair off, cutting it, writing two (single)
letters (characters), erasing in order to write two letters, building,
demolishing (in order to rebuild), kindling, extinguishing (fire),
hammering, transferring from one place into another. These are the
principal acts of labor—forty less one.
baking is cooking here and includes "boiling, frying, baking and roasting" (Shulchan Aruch 318:7.)
Interesting thing is that it says not to kindle on Sabbath but it
seems that if you kindle fire before Sabbath and don't refuel it you
can still use that fire that's where lighting candles before Sabbath
came from.
Even though cooking boiling, roasting, frying and baking are prohibited on Shabbat, and we may not kindle or extinguish a flame, whether for cooking or any other purpose, there are permissible ways to serve warm food on Sabbath.
one of the oldest interpretations of these verse i found is quite good and gives you general idea whats going on
Ye Shall Kindle No Fire, etc. Since it says: “In plowing time and in
harvest thou shalt rest” (Ex. 34:21), which means: Refrain from
plowing in the harvest time, that is, that one must refrain from
plowing in the sixth year for the sabbatical year, I only know that
already on the sixth year one must rest from work which is done for
the sabbatical year. But one might think that in like manner a person
should rest on Friday from work done for the Sabbath. And the
following argument might be advanced: The sabbatical year is observed
in the name of God, and the Sabbath day is also observed in the name
of God. Now, since you have proved that one must rest during the sixth
year from work for the seventh, it follows also that one should rest
on Friday from work for the Sabbath. And furthermore, by using the
method of kal vaḥomer one could reason: If in the case of the
sabbatical year, for the disregard of which one does not incur the
penalty of extinction or of death at the hands of the human court, one
must begin already on the sixth year to rest from work for the
seventh, it is but logical that in the case of the Sabbath, for the
disregard of which one incurs the penalty of extinction or of death at
the hands of the human court, one should already on Friday rest
from work done for the Sabbath. In other words, or to be specific,6
one should not be permitted on Friday to light a candle, or to put
away things to be kept warm, or to make a fire, for the Sabbath.
Therefore Scripture says: “Ye shall kindle no fire in your
dwelling-places on the sabbath day.” On the sabbath day itself you may
not kindle a fire, but you may on Friday kindle a fire for the
Sabbath.
Another Interpretation: Ye Shall Kindle No Fire in Your
Dwelling-Place on the Sabbath Day. Since it is said: “Fire shall be
kept burning upon the altar continually” (Lev. 6:6), I understand this
to mean both on week-days and on the Sabbath. And how am I to
maintain: “Everyone that profaneth it shall surely be put to death”
(Ex. 31:14)? By applying it to all other works except the arrangement
for the fire on the altar. But it could be argued that it applies also
to the arrangement for the fire on the altar. And how am I to
maintain: “It shall not go out” (Lev. 6:6)? On all other days except
the Sabbath. Scripture therefore says: “Ye shall kindle no fire in
your dwelling-places.” In your dwelling-places you may not kindle a
fire, but you may kindle it in the Sanctuary. Said one of the
disciples of R. Ishmael: Behold it says: Ye Shall Kindle No Fire, etc.
Why is this said? Because it says: “And if a man have committed a sin
worthy of death,” etc. (Deut. 21:22–23). I might understand that
this applies both to week-days and to the Sabbath. And how am I to
maintain: “Everyone that profaneth it shall surely be put to death”
(Ex. 31:14)? By applying it to all other cases of death except that
decreed by the court. Perhaps it is not so, but it applies even to
deaths decreed by court? And I am to interpret: “And thou hang him on
a tree,” to mean only on all other days but the Sabbath? Perhaps
however it means even on the Sabbath? Therefore Scripture says: “Ye
shall kindle no fire,” etc. And you reason: Burning was included in
the general category of work prohibited on the Sabbath and it has been
singled out for special mention to teach that just as in the case of
“burning,” specifically mentioned, which is one of the modes of death
decreed by the court, the Sabbath laws are not to be superseded, so
also in the case of all the other modes of death decreed by the court,
the Sabbath laws are not to be superseded.
R. Jonathan says: Ye Shall Kindle No Fire. Why is this said? Since it
says: “And Moses gathered,” etc. (Ex. 35:1), I might understand that
one can become guilty only by transgressing all the laws against the
thirty-nine categories of work prohibited on the Sabbath. But
Scripture says: “In plowing time and in harvest thou shalt rest”9
(Ex. 34:21). But I might still say that one becomes guilty only by
transgressing at least two laws, but by transgressing less than two
one is not guilty. Therefore it says: “Ye shall not kindle any fire.”
And you reason: “Kindling” has been included in the general category
of work prohibited on the Sabbath. And it has been singled out for
special mention merely to teach: Just as in the case of the
specifically mentioned kindling, which is one of the thirty-nine
categories of prohibited work, one becomes guilty by doing it by
itself, so also in the case of all the other thirty-nine categories of
work it is but logical that one should become guilty by doing each one
of them by itself. R. Nathan says: Ye Shall Kindle No Fire, etc. Why
is this said? Because it says: “And Moses gathered the whole
congregation of Israel,” etc. I might understand this to mean that one
should not be allowed even on Friday to light a candle, or to put away
the things to be kept warm, or to make a fire, for the Sabbath.
Therefore it says: “Ye shall kindle no fire in your dwelling-places on
the sabbath day.”11 Only on the Sabbath day you shall not kindle any
fire. You may however kindle a fire on the day of a festival.
Mekilta de-Rabbi Ishmael
Of course, all Sabbath prohibitions are suspended when human life is deemed to be in danger (pikkuaḥ nefesh)—in such a situation it is a religious duty to violate them if that is what is required to save a life.(Yoma 85a–b.)
This principle is grounded in
Leviticus 18:5: “You shall keep My laws and My rules, by the pursuit
of which man shall live; I am the Lord.”
On the Sabbath, see N. A, Barack, A History of the Sabbath (New York:
Jonathan David, 1965); N. E. Andreason, The Old Testament Sabbath: A
Tradition-Historical Approach (Missoula, Mont.: Scholars Press, 1972);
M. Tsevat, “The Basic Meaning of the Sabbath,” ZAW 84 (1972):> 447–459; A. Toeg, “Genesis I and the Sabbath” (Hebrew), Betb Mikra 50
(1972): 288–296; W. M. Weinfeld, “Sabbath, Temple Building, and the
Enthronement of God” (Hebrew), Betb Mikra 69 (1977): 188–193; W.
Hallo, “New Moons and Sabbaths,” HUCA 48 (1977): 1–18; J. Tigay,
“Notes on the Development of the Jewish Week,” Eretz-Israel 14 (1978):
111*–121*.