How is Internet Recovery able to connect to my Wi-Fi access point even after I changed the hard drive?
Passwords for the previously connected Wi-Fi access point are also stored in your Mac's NVRAM (along with the keychain which is managed by macOS and is stored in your hard drive).

From the Apple Support article, Reset NVRAM or PRAM on your Mac:


  NVRAM (nonvolatile random-access memory) is a small amount of memory that your Mac uses to store certain settings and access them quickly.
  
  Settings that can be stored in NVRAM include sound volume, display resolution, startup-disk selection, time zone, and recent kernel panic information. The settings stored in NVRAM depend on your Mac and the devices that you're using with your Mac.


That explains why your Mac is able to retrieve and connect to previously known Wi-Fi access point, even after swapping the hard drive.

The data stored in NVRAM is for use by your Mac and is not directly user accessible.