In the MMIO approach, the CPU understands that a certain region (or several) of its address space is reserved for I/O peripheral memory. You can actually look up the region(s) by referring to the physical memory map of a given processor's (or SoC's) datasheet.
To help make this clearer, let's take a look at a real example: the Raspberry Pi. As you'll be aware, this popular board uses a Broadcom BCM2835 (or later) SoC. The BCM2835 ARM Peripherals document at https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf, on page 90, provides a screenshot of a small portion of its physical memory map. The mapping of the SoC's General Purpose Input/Output (GPIO) registers shows a portion of the hardware I/O memory in the processor's address space: