Last December I connected to a wifi network with a password. A couple weeks ago I got a new hard drive for my computer. Today, I reconnected to that wifi network (this is the first time since I changed my hard drive) and my computer automatically connected to it.
I expected the computer to lose network credentials when switching the hard drive, but it did not. Where is network information (such as credentials) stored on a Macbook Pro?
Best Answer
Your Mac also stores the information about Wi-Fi access points it connected to in NVRAM.
From the Apple Support article:
While iCloud keychain also stores the Wi-Fi access point information, it's tied to a users Apple ID.
So if you are looking for a scenario where you want to give away your Mac to someone else, and do not want the Mac to retain crucial information such as your Wi-Fi access point password, you could, in addition to wiping the hard drive/reinstalling the operating system also take additional steps to reset NVRAM and PRAM on your Mac.
The linked article describes the steps to reset NVRAM and PRAM.