Page Numbers:
See
Numbering Front Matter (Ribbon) to start with.
Page numbering is formatted by Word
Section. Such sections may have little to do with logical sections although they may correspond to your logical sections. Section breaks can be used to restart numbering but are also inserted automatically and without notice for column, margin or layout changes.
Page Numbers in Word 2007-2016
Big gaps:
These are likely caused by paragraph formatting which should be contained in paragraph styles.
You would want to modify the paragraph style.
The key settings would be "Keep lines together" which keeps a paragraph from breaking across pages if possible, and "Keep with next" which requires a paragraph to be on the same page as the following paragraph, if possible.
Understanding Styles in Microsoft Word
To see what is going on in the formatting of a paragraph that appears on a new page when there is room for it on the previous page, see
Word's Reveal Formatting Codes.
Note, the references I gave you are to the Windows version, but the same principles apply in the Mac version.