This technique is explained in a very formal way in the paper:Poisson Image Editing (Patrick Perez et al. Microsoft Research UK)
A really nice and understandable tutorial on the maths behind this is : https://www.youtube.com/watch?v=UcTJDamstdk
The main goal of this implementation is to seamlessly blend a pieace of an image to another image. Of course the first we can notice is that we cannot do worse than just cropping and pasting the two images.