From the factory your Mini shipped with an EWS module (Immobilizer) that contains 10 preset and active immobilizer codes. Your Mini came with a certain number of keys with chips in them from the factory. These codes can be locked out so that any lost keys will not start your car, the keys will however still be able to unlock your doors. In addition, you can program up to 4 remotes into the BC1 at a time and can delete any missing remotes so they won't remotely open your doors.
If you go to the dealer and purchase a new key they will ask you for proof of ownership and your VIN #. The dealership does not do anything with the keys except take your money and program remotes. Instead, they subcontract out to another company who cuts the blanks and programs the immobilizer chip. This company takes your VIN and looks up which of the 10 preset codes have been issued to your car. If you have any codes left, you are issued another chip with one of the remaining preset codes. If you do not have any codes left, you will have to purchase a new EWS unit. The key that they ship to the dealer will start your car and open the doors without any intervention from the dealer, however If it is a remote key, it will not open the doors remotely until the remote is paired to the car.
If you want tackle it yourself, you can purchase an immobilizer chip coder and the chips (ID44) and do it all yourself. The cheaper chip coders require you to take out your EWS unit and touch wires to specific points in the unit for the coder to read out data. The more expensive units can code EWS data through the OBDII port, but they are not cheap. One good thing about not going through the dealer is that you can program the EWS to accept more than the 10 preset codes. This may be a cheaper option if you find that you need a new EWS because all 10 preset codes have been used. Additionally, some locksmiths have the ability to do the EWS coding, so you may be able to find someone that could help you get the deal done without having to go through the dealer.