Your word processor assumes that a word space marks a safe place to flow text onto a new line or page. A nonbreaking space is the same width as a word space, but it prevents the text from flowing to a new line or page. It’s like invisible glue between the words on either side.
Put a nonbreaking space before any numeric or alphabetic reference to prevent awkward breaks. (See example in paragraph and section marks.)
Use nonbreaking spaces after other abbreviated reference marks (Ex. A, Fig. 23), after copyright symbols (see trademark and copyright symbols), and between the dots in Bluebook-compliant ellipses.
In citations, use your judgment. In the citation Fed. R. Evid. 702, you can put a nonbreaking space before the 702 so it won’t get separated from Evid. But certain citation formats, like the California Style Manual, don’t use spaces in the abbreviated name of the source (116 Cal.App.4th 602). In those cases, the nonbreaking space can cause more problems than it solves, because it creates a large, unbreakable chunk of letters.