fitting gearing into the BB seems appealing until you bother to do some sums. The fundamental issue is that gearboxes (of any given size/weight) die very quickly if they see too much torque. Because (in most applications) the wheel must turn about three or four times faster than the cranks, the most common torque loadings are about 1/3 or 1/4 if the gearbox is in the hub vs in the bottom bracket.
Thus it is no accident that the most common gear-based variable gearing system ( the 3s hub) lives in the rear wheel; to give the same gear ratios and net strength in a BB gear would require a bigger and/or heavier arrangement. The hub gear has other advantages too, for both manufacturers and user; the bike need not be designed around the gearing system per se and a replacement wheel is a viable repair or conversion for an owner.
However things are different if the gearing system is required to have some very low gears, e.g. with about a 1:1 ratio (crank rpm vs wheel rpm). This is obviously more likely to be the case if the wheel size is large and the road speed is low, so MTBs and touring bikes are likely to fall into this category. Then there is no advantage in terms of lower torque at the hub, and the gearbox weight isn't so likely to be very much different.
However the whole bike has to be increasingly designed around the gearbox, so the resultant machine becomes extremely focused.
In general the more gears you have in a gearbox, the larger fraction of the net cost of the machine is taken up in the gearbox, whether it is a frame mounted gearbox or an IGH. In extremis half or even three quarters of the cost of the whole machine might be tied up in the gearbox, and problems within it may be very expensive to resolve if not covered by a warranty.
There is of course lots of detail in terms of how the gearbox is configured internally. Planetary gear systems are attractive, in that there is only one (easily dealt with) reaction load that might have to be accommodated in a structure external to the gearbox internals. By contrast a layshaft gearbox (e.g. the Pinion) needs to sit inside a very stiff housing, because there are large reaction loads that are not self-contained within the moving parts.
The Pinion gearbox is (clutching aside) based on the same kind of technology that is used in a typical car gearbox. But, perhaps worryingly, layshaft gearboxes in cars and motorcycles are not especially noted for their high efficiency; losses of tens of percent are commonplace. Whether a modern BB gearbox is comparably efficient to an IGH remains to be seen; I've not seen any independent tests of this as yet. Personally I doubt that this will be the case, but it remains to be seen.
Note that whilst they are commonly layshaft or planetary depending on whether they are frame mounted or IGH gearboxes, this is not an exclusive arrangement; folk have used planetary gearing systems in frame-mounted arrangements, and in fact once you allow the structure to rotate you can use what is effectively a layshaft gearbox as a simplified, lopsided IGH. The Dursley Pedersen 3-speed hub (circa 100 years ago) was configured in this way; however this approach must have some kind of fundamental problems, because it has not been a route that has been used much since.
In terms of gear ratios, it is arguably easier to design a layshaft gearbox with relatively few stages and evenly spaced ratios than to use an IGH to do this, unless you add extra stages to the IGH. Both Alfine 11 and Rohloff hubs effectively use up to three planetary gear stages in series which makes some gear ratios noticeably less efficient than others. Neither IGH fully utilises the potential number of ratios, either; the Alfine 11 could have 12 ratios and the rohloff structure could similarly have 18 gears instead of 14. In both cases practical issues (shifting characteristics, gear ratio spacing) make the reduced ratio set a pragmatic choice.
In terms of net efficiency, this will also vary with duty cycle, so the average efficiency is weighted by the usage that each gears sees. In general if your duty cycle uses the 1:1 gear ratio in a gearbox much of the time, higher losses in other gears may be tolerable, because they don't affect the overall efficiency that much. This is basically how car gearboxes succeed despite relatively low efficiencies in many of the gears; if for much of the duty cycle, you trundle down the motorway in a high gear that is 1:1 inside the gearbox, losses are minimised.
A similar consideration applies to a lot of IGHs, eg 3s hubs, some 5s hubs, some 8s hubs, even the Rohloff hub; tapping along on the flat can be arranged to use the 1:1 ratio (or one close to it) which is intrinsically efficient, and this can occupy much of the duty cycle. I worked out that with a well-used 1:1 ratio, the average efficiency of some IGHs was lowered only by 1% (in my use) or so despite some gear ratios having losses of 15% or so. If efficiency is a concern, it makes sense to choose the gearing system to match the expected duty cycle.
It is also worth bearing in mind that all gearing systems (with very many ratios) work by multiplying one set of gears with another. Typically x2 or x3 is applied to a simpler system to give an increased range or more ratios. Obviously there is no necessity to have the whole gearing system based around any one technology, so for example you can have an IGH combined with a cassette, or an IGH combined with a simple derailleur system. Systems of this sort can be very flexibly configured and can offer a gear range, shifting characteristics, running costs and overall duty cycle efficiency that would not be possible using any single technology, and that can be matched to particular needs.
A good example is the 6s Brompton gearing; the machine needs a tensioner anyway, so adding a 2s derailleur has only a small impact on the machine, yet allows a reliable and simple IGH to yield six ratios instead of just three, still with high average efficiency. In operation it is still possible to do large block shifts when stationary, which is important for most users of this type of machine. It is likely that various different hybrid systems may offer the most cost-effective, efficient, and flexible solution for a lot of other applications too.