Name of the relationship between something positive you do for someone else and what is done for you by a third party

There is cast your bread upon the waters from Judeo-Christian thought (the book of Ecclesiates 11:1 to be exact) and good karma from Hindu/Yogic/Buddhist thought.

The best fit from English idioms, however, is probably what goes around comes around. This is often taken in its negative sense (do evil to others and evil will be done to you) but is equally applicable to the doing of good to others, particularly in the form of random acts of kindness.