Suppose a string contains two angle-bracketed fragments: <Ninjas><Unite!>. The pattern /<.*>/ matches the whole string because * is greedy. Change it to /<.*?>/ and it matches only <Ninjas>. Appending ? makes a repetition operator non-greedy: it consumes as little as needed for the rest of the pattern to match. section 12.2.2
“As little as needed” still depends on what follows the quantifier. In /[1-9][0-9]*\s+[a-z]+s/, the greedy [a-z]+ initially consumes all of dresses, then gives back its final s so the pattern can finish. A non-greedy [a-z]+? would instead stop before an earlier s that lets the pattern match. section 12.6.3
Use non-greedy matching when you want the first suitable stopping point, not the longest one. The angle-bracket example is deliberately not HTML: real HTML has edge cases better handled by a parsing library such as parse5. section 12.2.2

