Two kinds of quote mark, and when each one breaks something
There are two families of quote marks. Straight quotes, " and ', come from the typewriter, which had no room for separate opening and closing keys. Curly quotes, also called smart quotes or typographer's quotes, have a shape for each side: “ and ” for double, ‘ and ’ for single. Printed books use curly quotes. Code, data files and most command lines need straight ones. Text moves between those worlds all the time, and the wrong kind causes real failures.
The common failure goes like this. Someone writes a command in a document, and the word processor curls its quotes as they type. You copy it: curl -H “Accept: text/plain” example.com. The shell does not treat “ as a quote, so the header is split at the space and the command fails with a confusing error. Paste it here with Straight chosen and you get curl -H "Accept: text/plain" example.com, which works. The same happens with JSON, CSV headers and spreadsheet formulas.
The other direction matters for anything people read. Paste "It's done," she said. with Curly chosen and you get “It’s done,” she said. The first quote opens because it starts the text. The apostrophe in It's closes, because it follows a letter, and the closing single quote is also the correct apostrophe. The quote after the comma closes. A word such as '90s gets an apostrophe even though it follows a space, because the tool knows that a quote before two digits stands for missing digits.
Straightening is exact: every curly mark has one straight form, so nothing is guessed. Curling has to guess which way each quote faces from the character before it. That rule gets ordinary prose right, including quotes inside quotes such as “It’s ‘fine.’”, and quotes after a dash or an opening bracket.
It is wrong in some places, and it is better to know them. Feet and inches, as in 5'10", get closing quotes instead of prime marks. A word that starts with an apostrophe and is not on the tool's short list, such as 'bout, gets an opening quote. Other languages' quote styles are not kept: German „Hallo“ is straightened correctly, but curling it gives English “Hallo”, and French « » guillemets are left alone in both directions. And code should never be curled, since no programming language reads ‘ or “ as a quote.