The Gemara on Amud Aleph uses an interesting phrase, הריני כפרת משכבו let me be an atonement for his resting place. Rashi (here and Kiddushin 31b) explains that the suffering of a son or Talmid could somehow achieve a penance or forgiveness for the father or master. Indeed the halakha is (Ramban Shaar Hagemul 41, Kiddushin 31b, Shulkhan Arukh YD 240:9) that one says this phrase about a deceased father or mother when repeating Torah in their name for 12 months after death , But not longer, because the tradition is that no Jew stays in Genenna longer than 12 months.
It is much easier to understand intuitively how giving charity and saying Kaddish (A public sanctification of God's name) achieved a penance for the deceased, because if their progeny or those who are influenced by the deceased continue to do mitzvahs, then it follows to reason that they should share in the merit. But how could someone else take another person suffering?
Rav Tzaddok (Takanas HaShavim 11) Addresses this somewhat by simply implying this as a broad principle in Judaism that forgiveness can be achieved by descendants for their ancestors.
For whatever it’s worth, We find the reverse situation operating in a biblical situation, when Rivka tells Yaakov, “Let your curse be onto me, my son.” (See Bereishis 27:13 though not all meforshim accept Rivka’s declaration as literally possible (see Abravabel, Ibn Ezra And other commentaries.)
Taz (YD, 240:12) Raises a question. If both saying Kaddish and saying הרני כפרת וגו׳ is in order to ease the punishments of Gehenna, why do we stop at 11 months for Kaddish and for 12 months for the Hareni? He answers that one can always abstain from saying Kaddish, and through inaction it does not show much at all, therefore it is better to play it safe and only say Kaddish for 11 months so as not to imply that your parent needed the maximum sentence as to require the full 12 months. However, when mentioning Torah in a parent's name, you have to either say zichrono leveracha or Hareni. That said, since you have to say something, you might as well say something that offers a prayer and merit for your parent in case there are more sins to atone for. Furthermore, It is extremely important that when prayers are uttered, that they have no falsehood in them, and in case the parent actually needs atonement still, it must be stated and not hidden behind euphemisms. (This is one of the many places where we see the extreme sensitivity to prayer being honest and accurate. We discussed this theme in other places in Psychology of the Daf, and it is important to keep in mind because of the spiritual and psychological implications.) In addition, Kaddish is recited publicly and therefore a greater embarrassment, as opposed to Hareni which is said in less public situations.