If for some reason your car forgets the key's remote id then it will need to be resynced. Below are the steps to resync the key to the car. The procedure below is scanned directly from the BMW owner's manual. BMW is not trying to keep this a secret so they can make money doing it for you. It says for New transmitters, but, it works for old transmitters as well. The procedure is the same for the newer diamond shape keys, just remember that Button 1 is the unlock button (the button closest to the key blade) and Button 2 is the lock button (center button with the BMW logo). Have all the keys with you when doing the resync procedure. Keys not synced will be forgotten by the car and will not work! This procedure is for the remote keyless entry only and has NOTHING to do with the ability to start the car. It will not fix keys that do not start the car or vice versa. Old Key/New Key information.

The procedure above has two glaring omission. First omission - Steps 3 and 4 must be performed on all the remote keys or they will be forgotten by the car. After completeing step 4 grab the next key and start at step 3. You have 30 seconds to complete steps 3 and 4. Second omission - At the end of step 4, when button 1 is released, the door locks will make a clunk - clunk noise. This means that the car has accepted the key. If no noise is heard then repeat steps 3 and 4. You have 30 seconds. After 30 seconds you will need to start all over again.
Frequently asked questions
1 - When the procedure says to close the doors it just means the passenger compartment doors. It does not mean the hood, trunk or convertible top.
2 - Position 1 in the steering lock is the Accessory position, but, Position 2, the ON position, also works.
3 - Step 3 says rapidly pressing button 2 three times in succession. It doesn't have to be done rapidly. 1-2 seconds between presses is fine. Step 3 just needs to be completed within 10 seconds.
4 - Diamond shape keys do not have an LED so disregard this part of Step 4.
5 - The order in which the keys are initialized is not critical. If they are not initialized in the same order as they were originally the key memory functions will not be assigned to the correct key. Try repeating the whole resync procedure, but, sync the keys in a different order.