Modern car keys have three elements:
The physical metal key. This needs a very expensive machine to automatically measure and cut a new one, or quite an expensive machine and a skilled operator.
The key fob has a transponder which the car engine immobiliser needs to ‘interrogate’ and ‘approve’ before it allows the engine to start.
Finally, the new key fob needs to be registered by, and paired with, the vehicle alarm and central locking computer, before it will allow entry. This requires an expensive computer to connect with the car alarm computer and write the new key fob identity into its memory.
And of course your own identity and ownership of the vehicle will need to be carefully established.
This is why modern car keys cost so much to replace, and the workshop time to access the car computers and reprogram them – although as usual the car dealers charge over the odds and rip us all off.
I have just bought an expensive Autel computer tablet for car maintenance, which should also do the two latter functions, but I have not tried it on those functions yet.