Modern cars, such as this BMW X5, have very complicated and expensive keys!
The other day, the X5 refused to start - it didn't crank, click, or nothing. Turn the key and NADA. I dicked around with 100 different things before going online and reading of similar problems other people had with older BMWs. The common denominator was "try the other key".
Well, sure enough, that worked, which is why the Internet can be useful at times.
Older keys can go "weak" and no longer be recognized by the engine management computer(s). BMW keys, in addition to having a "cut" part, (which is an internally serpentine cut, not available at your Home Depot key department) have an RF chip which is read by an antenna surrounding the ignition switch. When this goes South, the key works only intermittently and then not at all.
The solution is to get a new key - about $250 from the dealer (as it incorporates the remote control as well).
And this illustrates why it is important to have an extra key for your car. When buying a used car from a dealer, oftentimes, they come with only one key (auction cars in particular). Since new keys on newer cars (many of which don't even look like keys, but matchbooks) are so expensive, it pays to make sure you get a spare - rather than pay for it later on.
NOTE that many modern keys, particularly those with the door lock transmitters built-in, are recharged by the keyhole when you drive. If you have an extra key, use it in rotation with your other key, so that it remains charged. There is a small battery inside the key itself. I am told that if you have an extra key and you let it sit for a year or so, it may go bad and not take a charge.
Of course, it is a pain in the butt that a key can wear out, but modern cars all have these overwrought anti-theft devices that seem to cause more trouble to the owners than to thieves.
Before you call a tow truck, try the other key!