Which number goes on which page
Numbers run in document order, not in the order you type pages. The first page that gets a number receives the starting number, the next one gets the number after that, and so on - so starting at 5 on a three-page file gives 5, 6 and 7 rather than renumbering the front of the file.
That is what makes continuations work. If a report is split into two files, number the second one starting at the number the first one finished on. Cover pages and tables of contents are handled by leaving them out of the list: the page list takes ranges and the words odd and even, so 2- numbers everything except the first page, and 3- skips a cover and a contents page.
The wording comes from a small set of formats - 1, Page 1, 1 of 10, Page 1 of 10 - and the "of" total is always the last number printed, not the length of the file. That keeps a continued file honest: a three-page insert numbered from 5 reads Page 5 of 7 through Page 7 of 7, which is what a reader holding the rest of the document expects to see.
Cropping is a window, not a pair of scissors
Trimming the margins moves the visible window of the page, which is the honest way to describe what a PDF crop does. The page underneath keeps every byte: the content outside the new window is still in the file, still searchable, still extractable, and can be revealed again by any editor that lets you reset the crop box. The file does not get smaller either.
That has a practical consequence worth repeating: cropping must never be used to hide information you need to keep secret. A scanned form with an account number in the corner is not redacted by cropping - the number is still in the file. It is a presentational tool for prints and screenshots, and the result of this tool says so in plain words instead of implying otherwise.
What cropping does change is where the page number goes. The number is placed inside the new, smaller window - a third of an inch from the cropped edge - so a trimmed page does not end up with its number behind the cut. If the margins you type would leave a strip thinner than a quarter of an inch, the job stops with a message naming the page rather than producing a sliver.
What is written into the file, and what is left alone
The numbers are drawn as ordinary page content with the standard Helvetica font, so they print like anything else on the page, they stay in the text layer, they can be searched for, and they need no embedded font file. They are drawn after the page content, which puts them on top of whatever is underneath - normally blank margin, occasionally a footer line you may want to check.
The PDF's own page labeling system is not touched. A PDF can carry page labels, which is how a reader shows "i, ii, iii" for front matter and then restarts at 1; this tool adds printed numbers on the page and leaves that structure exactly as it found it. That is usually what people want, and it is worth knowing that the two systems exist side by side.
Pages that already carry their own rotation follow the same rule as anywhere else: a top or bottom number drawn on a page stored sideways appears along a side edge in some viewers. Nothing is re-rendered, nothing is recompressed, and the original file on your device is never modified - the result is a new download.