That's an interesting question. The short answer is: All the settings needed
for you to connect to a network are stored on your hard disk along with your
other software.
Hardware devices do contain memory chips, and sometimes these memory chips
can even be updated (as when you 'upgrade the firmware'). Nonetheless, you
can change NICs (Network Interface Cards) - and video cards, sound cards,
etc. - without losing anything, because all the software needed to make
these cards work is stored on the hard disk. Swap away.