When the car rolls off the assembly line...10 key codes are programmed into the EWS control module. The 1st owner received 4 of those keys (2 remotes, 1 spare, 1 valet).
Your EWS control module's 10 key codes are specific to each BMW based on the car's VIN. That is how the dealer can order keys & they come from BMW already programmed with your car's ISN (individual serial nbr) that matches the same EWS ISN burned to your DME, EWS-CM, & other keys.
See info below how the original 10 key codes are programmed at the factory...and as previously mentioned...EWS is not the same programming as FZV (remote central locking) & DWA (anti theft alarm siren system).