\sloppy is a latex macro that does
\def\sloppy{%
\tolerance 9999%
\emergencystretch 3em%
\hfuzz .5\p@
\vfuzz\hfuzz}
\fussy sets the values back to the latex defaults
\def\fussy{%
\emergencystretch\z@
\tolerance 200%
\hfuzz .1\p@
\vfuzz\hfuzz}
\tolerance sets the maximum "badness" that tex is allowed to use while setting the paragraph, that is it inserts breakpoints allowing white space to stretch and penalties to be taken, so long as the badness keeps below this threshold.
If it can not do that then you get overfull boxes. So different values produce different typeset result.
\emergencystretch (added at TeX3) is used if TeX can not set the paragraph below the \tolerance badness, but rather than make overfull boxes it tries an extra pass "pretending" that every line has an additional \emergencystretch
of stretchable glue, this allows the overall badness to be kept below 1000 and stops TeX "giving up" and putting all stretch into one line. So \emergencystretch does not change the setting of "good" paragraphs, it only changes the setting of paragraphs that would have produced over-full boxes.
Note that you get warnings about the real badness calculation from TeX even though it retries with \emergencystretch the extra stretch is used to control the typesetting but it is not considered as good for the purposes of logging.
\hfuzz does not affect the typesetting in any way but just stops TeX complaining if the box is is only slightly over-full.
\hbadness not used in \sloppy but used in the final example below` is similar, it does not affect the typesetting but stops TeX warning about underfull boxes if the badness is below the given amount.
The main problem with \sloppy is the setting of \tolerance to 9999 which is almost infinitely bad. That does not distribute the white space evenly but encourages individual lines of the paragraph to stretch the white space to arbitrarily large amounts. This was an acknowledged deficiency in TeX and why in TeX3 the new parameter \emergencystretch was added. Unfortunately when adding \emergencystretch to \sloppy when definining it for LaTeX2e, we didn't reduce the \tolerance setting, but left it at 9999, which is probably good for compatibility with LaTeX2.09, but bad for everything else.
Note final settings show that often you get a better setting with just setting \emergencystretch and not changing \tolerance at all, the setting is the same in both cases, but \hbadness=10000 silences the warnings. Not everyone would want the final setting without being warned about it, but in automatic typesetting contexts where changing the input is not a possibility and you never want over-full boxes, this is a possibility.

\documentclass[12pt]{article}
\usepackage{showframe}
\begin{document}
\def\test#1{{#1
\texttt{\detokenize{#1}}
Long made-up words, sloppy:
abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl
\textit{abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl}
Long made-up words, textit, sloppy:
\textit{abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl abcdefghijklabcdefghijkl}
Here is a line with long unbreakable math, sloppy. ${a+b+c+d a+b+c+d}$ ${a+b+c+d a+b+c+d }$
Extreme unbreakable math, sloppy. ${a+b+c+d+e a+b+c+d+e a+b+c+d+e a+b+c+d+e }$ break ${a+b+c+d+e a+b+c+d+e a+b+c+d+e a+b+c+d+e }$
\nobreak\bigskip\hrule\filbreak}}
\test{}
\test{\sloppy}
\test{\setlength\emergencystretch{\hsize}}
\test{\setlength\emergencystretch{\hsize}\hbadness=10000}
\end{document}
\sloppywill fix some cases that just setting\emergencystretchwon't fix, but just setting\emergencystretchhas the big advantage that it has no effect on good paragraphs, it only kicks in if the paragraph would otherwise have failed to be within tolerance.\sloppychanges the settings before the linebreaking is affected so can (and typically does) affect paragraphs that would have worked 9and looked better) with the default settings. – David Carlisle Nov 26 '15 at 12:17\emergencystretchbefore using\sloppy. But there is no single right setting it depends on circumstances. (If there was a clearly best setting for all cases, latex would not have\sloppyand\fussy) – David Carlisle Jan 28 '19 at 23:41\emergencystretchcan make things worse as stopping latex from hyphenating words and just stretching everything: Why my document is not hyphenating on words starting with upper case letter? (I am not using \uchyph=0) – user Jul 12 '19 at 01:41\sloppywith\begin{sloppypar} ...paragraph text... \end{sloppypar}– Dinei Sep 28 '20 at 03:20