Percent-Encoding in Practice
URL encoding replaces characters that carry special meaning in a URL with %XX hex sequences - a space becomes %20, an ampersand inside a query value becomes %26. Skip it and the URL either breaks or silently truncates at the first reserved character. The full character tables and the edge cases are in the URL encoding guide.
The tool offers two modes because JavaScript does: encodeURI keeps URL structure (slashes, question marks) intact and suits a complete address, while encodeURIComponent encodes everything and is what you want for individual query parameters. The most common bug in the wild is double-encoding - %20 turning into %2520 - which means two layers of your stack each encoded the same value.