Which characters are escaped
Three characters always change: & becomes &, < becomes < and > becomes >. The ampersand starts every character reference and the angle brackets start tags, so leaving them in place can break the page or let text run as markup. With the quote option on, " becomes " and ' becomes ', which you need when the text goes inside an attribute value such as title="...".
In the example, <p class="note">Fish & chips for 2 > 1</p> becomes <p class="note">Fish & chips for 2 > 1</p>, which a browser displays exactly as typed instead of drawing a paragraph.
What unescaping understands
Numeric references are decoded in both forms: decimal, such as ©, and hexadecimal, such as ©. Both give ©. A reference to a value that cannot be a character, such as � or a number past the end of Unicode, becomes the replacement character �, as browsers do.
Named references are decoded for all 252 names defined in HTML 4 plus ': the Latin-1 accented letters such as é and Ü, symbols such as © ® ™ € and °, Greek letters, math signs, arrows and typographic punctuation such as — and …. The current HTML standard defines over 2,000 names; a rarer one is left exactly as written, so nothing is silently lost. A reference must end with a semicolon to be decoded.
Escaping is one part of web security
Escaping text before inserting it into HTML is the main defense against cross-site scripting, where someone types markup or script into a form so it runs for other visitors. This tool is handy for preparing snippets, documentation and email templates by hand.
In an application, let your template engine or framework escape output automatically for each context. Text going into a URL, a script block or CSS needs different rules; for web addresses, use percent-encoding instead.