Where do APN come from? When running a fresh ROM, the APN settings are defined by the SIM card inserted, downloaded from the network via some handshake protocol or are they predefined in the rom for each network ?
They are included in Android. The correct settings are determined by your SIM MCC and MNC (Mobile Country Code and Mobile Network Code). If you want, you can view the list of preset APNs by looking at the source code, for example at android-source-browsing.

The file name in this case is /etc/apns-full-conf.xml, but apparently it varies.