The bottom bracket (BB) is an assembly that contains bearings and sometimes the axle that the cranks attach to. The bottom bracket shell is the part of the frame holding the bottom bracket.
Threaded bottom brackets
Traditional bottom brackets screw into the bottom bracket shell, and contain both bearings and an axle. BB axles/spindles for threaded bottom brackets can be square tapered (in two standards, JIS and ISO) or oversized (Shimano Hollowtech or ISIS). Generally, the oversized spindles were stiffer due to being larger, but had smaller bearings and may have had poorer bearing life. The crankarms were then fixed on to each side of the axle with retaining bolts.
External bottom bracket cups came into play in the early 2000s. Here, the bottom bracket assembly contains only the bearings, and the crank axle is attached to one or both crankarms. The axle goes through the bottom bracket.
Among bikes with threaded BBs, the vast majority conform to the English standard. Many Italian frames used the Italian standard. The current component manufacturers make BBs in at least the British standard to support modern cranks with 24-25mm axles, and many third-party BBs are also available. Thus, any Shimano Hollowtech II, SRAM GXP, or Campagnolo Ultra- or Power-Torque crank can be installed to any bicycle with a British threaded BB.
Some modern cranks have 29-30mm axles. Not all cranks with 30mm axles are compatible with British or Italian threaded bottom brackets. Interested users should check for compatibility. A modern oversized standard called T47 has been adopted by Trek and by some smaller custom builders. This has an internal diameter of 46mm (compared to the 35mm diameter of the British standard), and it can easily accommodate cranks with 30mm axles.
On most threaded BBs, the bearings are not accessible for maintenance. Users will frequently discard them when they are worn out. It is possible for users to damage the threads when installing BBs, e.g. by forcing a BB in at an angle. A bike store can chase the threads to attempt to restore them. In the worst case, it is possible to re-tap a British threaded BB to the Italian BB standard, because the latter has a slightly larger diameter (36mm vs 35mm for BSA). This will have to be done cautiously. Also, Italian BBs are right hand threaded on both sides, so the drive-side cup may unscrew as you pedal.
Press-fit bottom brackets
Later, various press-fit bottom bracket standards were developed where the frame contains a seat for bearing cups. These simplified the manufacturing process for carbon frames. For carbon frames to use threaded bottom brackets, the factory needs to bond an alloy sleeve into the BB shell, and there can be problems with the sleeve coming un-bonded. Press-fit BB cups are usually pressed directly into the frame like a headset. The crankset is then inserted as with external bottom brackets. In some press-fit arrangements, most notably Trek's BB90 standard, the frame contains the bearing seats, and the cartridge bearings are pressed directly into the frame's bearing seats.
There are numerous standards for press-fit bottom brackets. Cups for one standard are usually not interchangeable with a different standard. However, for each press fit BB standard, manufacturers will make cups to accept most or all cranksets on the market. Examples of open standards include BB86 and Press Fit 30. Some larger bike manufacturers have BB standards proprietary to their own frames, such as Trek, Cervelo, and Cannondale.
Generally, users looking to install a BB and crankset from scratch would determine the frame's BB standard, then find a bottom bracket in that standard that matches their desired crankset. On many press-fit BBs, users or bike stores can service worn bearings (i.e. clean and re-grease them) without replacing the cups, or extract the bearings from the cups. Naturally, the cups themselves can be replaced. Creaking is a known problem with press-fit BBs, and it is caused if the BB shell was manufactured out of specification (or if the shell got enlarged over time from a loose-fitting BB).
Also note that there are eccentric bottom brackets, which are really a bottom bracket that goes inside of an offset bottom bracket shell that fits inside the frame's bottom bracket shell. This allows the bottom bracket to be moved a bit, to tension the chain on a single-speed or fixed-gear bike.