To explain the difference between these two let me explain the difference between
The main difference is that:
encodeURIfunction is intended for use on the full URI.
encodeURIComponentfunction is intended to be used on .. well .. URI components that is
any part that lies between separators (; / ? : @ & = + $ , #).
encodeURIComponent these separators are encoded also because they are regarded as text and not special characters.
Now back to the difference between the decode functions, each function decodes strings generated by its corresponding encode counterpart taking care of the semantics of the special characters and their handling.