The two kinds of encoding, and why picking wrong breaks links
A URL has structure: the colon after the scheme, the slashes between path segments, the question mark before the query, the ampersands between parameters. Those characters are punctuation. Encoding them turns the punctuation into text and the URL stops being a URL.
Inside a parameter value, the same characters are data. A search term containing an ampersand must be encoded, or the server reads it as the start of another parameter and the value is silently truncated at that point. This is where most broken links come from: a value encoded with the whole-URL rules, so its ampersand survived and split the query.
The practical rule is to encode each value on its own, then assemble the URL from the encoded pieces. Encoding an already-assembled URL is a repair job, and it can only guess which characters were punctuation and which were data.