encodeURL and encodeRedirectURL are methods of the HttpResponse object. Both rewrite a raw URL to include session data if necessary. (If cookies are on, both are no-ops.)
encodeURL is for normal links inside your HTML pages.
encodeRedirectURL is for a link you're passing to response.sendRedirect(). It has slightly different syntax requirements