With intent being so important, would the karmic benefit of saving someone's life because they were in danger be the same as doing it because you thought you would be rewarded for it?
While the act of saving someone's life does bring great overall benefits to the person's future lives, his intent does influence the orientation of such wholesome rewards. For example, a person performing the act with the intent toward relinquishment and liberation will receive an outcome conducive toward that direction, while another performing the same act, but with the intent of gaining worldly rewards, hence would also get positive outcomes, though oriented towards more of a mundane worldly kind of merits.
The Pali scripture says "kamma is intention"
Intention, I tell you, is kamma. Intending, one does kamma by way of body, speech & intellect.
Therefore, intention born of greed will not be the same as intention born of good-will.
Bhikkhus, a god, a human or any other good state would not be evident from actions born of greed, hate and delusion. Yet, bhikkhus, from actions born of greed, hate and delusion a hellish being, an animal birth a ghostly birth or some other bad state would be evident.
The intent is certainly the most important thing for karma.
Let's use giving gifts as an example.
There are eight reasons why one may give gifts.
“Bhikkhus, there are these eight grounds for giving. What eight? (1) One gives a gift from desire. (2) One gives a gift from hatred. (3) One gives a gift from delusion. (4) One gives a gift from fear. (5) One gives a gift, thinking: ‘Giving was practiced before by my father and forefathers; I should not abandon this ancient family custom.’ (6) One gives a gift, thinking: ‘Having given this gift, with the breakup of the body, after death, I will be reborn in a good destination, in a heavenly world.’ (7) One gives a gift, thinking: ‘When I am giving this gift my mind becomes placid, and elation and joy arise.’ (8) One gives a gift for the purpose of ornamenting the mind, equipping the mind. These are the eight grounds for giving.”
All eight are not equal.
Of the eight listed, the last one, which is ornamenting the mind or adorning the mind, is the highest reason with the highest benefit.
Please see this answer for details on what is meant by "ornamenting" or "adorning" the mind.
“Yes, Sariputta, there would be the case where a person gives a gift of a certain sort and it does not bear great fruit or great benefit, whereas another person gives a gift of the same sort and it bears great fruit and great benefit. .......
“Having given this gift seeking his own profit—with a mind attached [to the reward], seeking to store up for himself, [with the thought], ‘I’ll enjoy this after death’—on the break-up of the body, after death, he reappears in the company of the Four Great Kings. Then, having exhausted that action, that power, that status, that sovereignty, he is a returner, coming back to this world. ......
“—but with the thought, ‘This is an ornament for the mind, a support for the mind’—on the break-up of the body, after death, he reappears in the company of Brahma’s Retinue. Then, having exhausted that action, that power, that status, that sovereignty, he is a non-returner. He does not come back to this world.
“This, Sariputta, is the cause, this is the reason, why a person gives a gift of a certain sort and it does not bear great fruit or great benefit, whereas another person gives a gift of the same sort and it bears great fruit and great benefit.”
No the two are different in intent and what that intent does to you.
When you save someone with the intent of saving that person, that act is an act of compassion. Its an act you performed for the benefit of the other person. Not to accrue something for you. When you do such an act that Karma does little or no contribution to reinforce that the saknkna (signal) of yourself. Thus, such an act of altruism does not contribute to you building 'sakhkhaya dhitti' (the mistake of taking the process of living as a person - in short: 'I').
When you do the same act with an expectation on your mind, that act reinforces the concept of 'self' in you.
Say you saved person X, that means;
- You are the savior of X
- X exists
- X exists as part of the existing World
- If X was Saved by me, then I exist
- Because World exists and I perceive it, I exist
At the core of it, the effort is to reinforce yourself that 'you' exist. This is quite dangerous for the practicing Buddhist. This is why, practicing Buddhists perform their acts without any expectations or returns. They are trying to see through the process which we simply take for-grant as 'myself'. Anything that reinforces it, is thought of as a hindrance to Nirvana.