The Talmud asks that since Shmuel permits a Davar she’Eino Mitkaven, like Rebbi Shimon, he should also permit a Melachah she’Einah Tzerichah l’Gufah. The Gemara answers that the two concepts are not related.
Why does the Gemara initially assume that the two concepts are related when they have entirely different laws? First, a Davar she’Eino Mitkaven is permitted on Shabbat, while a Melachah she’Einah Tzerichah l’Gufah is prohibited mid’Rabanan even according to Rebbi Shimon. Second, the concept of Davar she’Eino Mitkaven applies to all prohibitions in the Torah, while the concept of Melachah she’Einah Tzerichah l’Gufah is a concept unique to Shabbat, which is derived from the verse of “Melechet Machshevet” (Shmot 35:33). We see that they are two completely independent Halachot. Why does the Talmud compare them?
(a) Tosfot (DH Afilu) explains that whenever a person does an action that unintentionally results in a Melachah being performed (that is, he does a Davar she’Eino Mitkaven), by definition the Melachah that results is not Tzerichah l’Gufah (because the person had no need to perform the Melachah). Hence, the Talmud’s initial assumption was that the reason why, on Shabbat, Rebbi Shimon permits a Davar she’Eino Mitkaven is because even if a Melachah is done unintentionally, it remains no more than a Melachah she’Einah Tzerichah l’Gufah, which he prohibits mid’Rabanan. Similarly, the Gemara assumed that Rebbi Yehudah prohibits a Davar she’Eino Mitkaven because of the possibility that it will result in a Melachah that the Torah prohibits, since he considers a Melachah she’Einah Tzerichah l’Gufah to be a Torah transgression.
(b) The Tosfot Ha’Rosh and Tosfot in Zevachim (92a) explain that the Talmud initially assumed that if a Melachah she’Einah Tzerichah l’Gufah is forbidden, it is because one’s intention does not make a difference (that is, even though he did not intend to perform the Melachah for its normal purpose, he is still liable). If one’s intention does not make a difference, then it stands to reason that not only does not having intention to perform the Melachah for its purpose not make a difference (and he is still liable), but not having any intention at all to do the Melachah also does not make a difference.