They are interpolation algorithms. When you register images, you end up with noninteger displacements. So, if you had a sequence:
12 52 8 6 10 15
and you want to know the value at the "coordinate" 2.3 (for example, starting from position 1), you have to use an interpolation algorithm to know this value.
The nearest neighbour algorithm just looks for the integer valued pixel that is closest to the desired location. In this example, 52.
The linear interpolation algorithm is a more "clever" way to get the desired value. Just averages the values of the closest neighbours, depending of the distance. In this case: 0.7*52+0.3*8
There are much more sophisticated ways to guess what is the "real" value in the continuous range. One of them is the Lanczos-3. Another are the splines. They generally assume that there are certain functions that models how the pixel vary, and the pixel values at the integer positions give you the amplitude of those functions. Then, you just evaluate the functions at any desired location. Roughly, different function models assume different behaviours of the underlying signal. Some of them tries to generate smooth images; others to preserve sharp edges, etc.
The nearest neighbour algorithm is the simplest and faster of these algorithm, but also most of the times is the one that yields poorer results. It does preserve well edges, and a sence of sharpness of the image, but at the expense of creating artifacts, and distorting shapes or objects.