nlfilter() slides the window across the image and applies some custom function, that you supply, to the pixels in the window. nlfilter can apply some custom function to the pixels in the window, something that conv2() cannot do.
conv2() slides the window across the image and multiplies the pixels in the window by the pixels in the filter kernel window and sums them. The output pixel is the sum. conv2() does not apply some custom function like nlfilter can.