MY 2011 and up .. the extended warranty is offered by BMW.
For MY's 2010 and earlier, BMW offers it through a 3rd party. The 3rd party also handles coverage for a lot of the other big car manufacturers. The price is determined as to how many km's you have on your car and the duration you want to be covered.
For the most part, it is a money grab. They have an idea as to the percentage of vehicles coming in for repair.. the rest is profit for them on the vehicle that don't need repair.