In Word, page numbers are fields. You are displaying the field.
The simplest way to toggle this option setting is with Alt+F9.
(Many computers require adding the Fn key to this shortcut.)
It can also be changed under File > Options.
Dealing with Fields in Microsoft Word
Page Numbers in Word 2007-2024 (365)
Using Fields in Microsoft Word