From Torah.org Rambam series
The concept of "Osek BMitzvah" has three general rules. (According to the Rambam)
If you are engaged in a mitzvah (meaning your mind and actions are completely engrossed in it) Then you are exempt from doing any other mitzvot.
This means that wearing tzizit does not patur you from other mitzvot because wearing them does not distract you. However if you are shaliach for someone, then you do not need to stop and eat in a Sukkah while traveling. However that same Shaliach is not patur from saying the Shemah. A Groom however, who is fully focused on his weddding, is patur from saying the Shemah.
There is an exception to rule 1. Learning Torah never exempts you from other mitzvot. If you are learning Torah and another Mitzvah needs to be done, then you do the other mitzvah. For example, Saying Shema. The reason for this is that Learning Torah is such an important mitzvah only because it leads to doing mitzvot!
There is an exception to rule 2 as well. If the mitzvah that presents itself, can be done by another person, and another person is in fact doing that mitzvah, then you are patur. For example, if a poor person comes to the beis midrash and asks for a meal, if others are already giving him food then you do not need to stop learning to feed him.
According to the Ran, there are extra criteria for making this distinction.
(a) "Weight" - we generally relate to Mitzvot from the Torah with more
severity than those ordained by the Rabbis; for example, a "Safek"
(case of doubt) is decided to the stringent side of the question if it
involves a law from the Torah; it is decided to the lenient side of
the doubt in case it involves a Rabbinic law. Therefore, as long as
(under normal circumstances), there will be enough time to fulfill the
Mitzva, we are not bothered by your putting it off. A "twist" on this
is to incorporate the "Safek" issue here: Since we are not 100% sure
that we will complete the activity in time and be able to perform the
Mitzvah properly, let us judge the situation as a "Safek" - if it
involves a Mitzvah from the Torah, we are stringent and interrupt; if
it is Rabbinic, we need not interrupt.
(b) "Legislation" - we could posit that the Rabbis, when they mandated
certain Mitzvot (e.g. Lulav during the rest of Sukkot after the first
day), never legislated that it should necessitate interruption;
whereas Mitzvot from the Torah carry this character with them.
(c) "Nature of the Concern" - perhaps the distinction begins from a
different issue: We don't interrupt for a Rabbinic Mitzvah, because
our only concern is that the Mitzvah be fulfilled - "to fulfill the
words of the Rabbis"; as long as there is sufficient time, we need not
interrupt our [mundane] activity for the Mitzvah. Contradistinctively,
when the time to perform a Mitzvah from the Torah ("the word of God")
has arrived, it is unseemly to get involved in another activity and
this involvement itself constitutes a "slap" at the Torah; the
obligation to interrupt the activity is a response to this
wrong-headed prioritization - putting your own needs before your
responsibility to God's commands.
For a more in depth analysis of this and related issues, see the link provided above.