How linear interpolation works between mipmaps? Nearest interpolation between 2 texels means to take the texel whose center is nearest to a given coordinate to draw or, in other words, the texel the coordinate is matching.
Linear interpolation between 2 texels means to mix the colors of them using more of the nearest texel and less of the others according to the distance to a certain coordinate.
Nearest interpolation between 2 mipmap levels consist in taking the mipmap whose size fits better the size of the image to draw
But I cannot understand how linear interpolation works with mipmap levels.
It's called trilinear interpolation. You first do a bilinear interpolation of the higher-res texture, then do a bilinear interpolation on the lower-res texture, then interpolate between the 2 results. The weight of the final interpolation is based on where between the 2 textures your Z-coordinate falls. If 0 is fully the low-res texture and 1 is fully the high-res texture, then you can use the standard glsl mix() function to combine the two:

result = (highres texture color * weight) + (lowres texture color * (1.0 - weight));