Others have four legs, which makes sense to me, as ground can be shared.
One of many examples of a six legged RGB LED is the Kingbright KAF-5060PBESEEVGC.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
According to the datasheet, it has six legs because it contains 3 LEDs, with nothing common:
Many RGB LEDs have a common cathode or common anode, so need only 4 leads. For some applications that may not be acceptable. For example, it wouldn't be possible to control two RGB LEDs with common cathodes or anodes in series, or to arrange them for charlieplexing.
Further, a part like this is at least more flexible. It can be made common anode, or common cathode. Or, a pair of the LEDs may be arranged in anti-parallel. It may make more sense in some situations to stock just one part than to stock several different parts to cover different cases.
These RGB LEDs have six pins because all the connections are brought out individually.
You didn't ask, but others may wonder why manufacturers do this. The advantages of bringing out all connections individually over tying some together in the package include:
Before you linked the datasheet and explained that it wasn't common anode, I commented that it might be mechanical or thermal relief.
For both of those purposes, you want larger pins or more pins. Large pins take longer to solder, so if more pins fit easily within a rectangle surrounding the device you might as well choose more pins.
This device claims a total power of 350mW, which is starting to get hot to the touch, so thermal design is definitely a consideration.
Single-colour LEDs often have a "pad" underneath, but in this case with three disjoint LEDs there would be the question of which signal to connect it to.
An actual reason for the non-common anode, according to the datasheet's "Description": the three sub-LEDs are manufactured on different substrates with different processes (may not be true for all RGB LEDs). Therefore there are three small dies in the package each of which has two bond wires. It's probably easier to bond them out to different pins.
Final note: the orange LED is much brighter than the other two in this package, for the same current.
For the specific led you mentioned, it is a standard 5050 PLCC-6 smd led package (It says 5060, but 5mm x 5mm is nominal sizing, 5.5 x 5.5mm typical). It's a pretty standard 6 pin leaded package.
The same package is used to allow multiple colored diodes (RGB, or RGB+White or RGB+Warm White+Cold White), or even entire micro-controllers like the WS2812 RGB led controller: