Why URLs need encoding
URLs can only contain a limited set of characters. Spaces, accents and symbols like & or ? must be replaced with percent codes such as %20, or the link breaks or means something different.
Encoding a query value makes it safe to insert into a link, for example a search term containing &. Decoding turns an unreadable encoded link back into text you can read.