In a script or behind a pipe, a pager waits for a key press and nothing happens.
--no-pager prints everything to standard output and exits. That is what you want when you count lines, feed another tool or save a copy to a file. The example counts the accepted logins of the SSH service.
journalctl -u ssh --no-pager | grep -c Accepted
When the output goes to a pipe, journalctl already skips the pager on its own, but I put the flag in scripts anyway, so the intent is visible.
Further reading: journalctl(1) manual page