Black, green, and white peppercorn are all the same berry (or, more precisely, drupe) of the peppercorn plant. The difference in color is due to the way the berries are processed.
The peppercorn plant is a perennial climbing vine in the Piperaceae family. It is cultivated and grows best in hot and humid regions and primarily grown in tropical southern India. Other places where it thrives have similar steamy environments since for best production the vine requires a long rainy season with high temperatures. In some areas the climbing vine is trained to grow on trees, whereas in others it is grown on trellis supports. Sometimes these supports can be found interspersed in tea or coffee plantations.
The berries are actually drupes. A drupe is a fruit that contains one seed—think peaches, cherries, olives, or even nutmeg if you have some spice knowledge. These drupes become yellowish-red when mature (7-8 months after flowering) and when any one berry on a spike-cluster has this hue it indicates to the farmers that harvest time has begun. However since the berries mature at different rates the berry spikes are picked at intervals and always by hand.
For black and green peppercorns, the berries are picked while not yet ripe. Entire spikes are picked while they are still hard, shiny, green, and plump. Later the spike clusters are threshed to separate the berries from the stems.
For the production of black peppercorns, the berries can be immersed in boiling for a short time (1 minute) before being spread out in a field to sun dry. The blanching purports to create a more uniform color, as well as promote faster drying—reducing the drying time from 5-6 days to just 3-4 or four. The blanching and drying helps to disintegrate the pulp of the fruit; the peppercorn skin wrinkles, shrinks, and sticks to the inner kernel. Dark uniform color is the aim.
For the production of green peppercorns, after threshing, the unripe berry is sometimes preserved with steam blanching which can deactivate enzymes and retain the color, aroma, and flavor. Sometimes these green peppercorns are placed in a salt-water or vinegar brine and can be purchased preserved. Others are dried after steam blanching with drying methods that attempt to retain their unripe color.
White peppercorns require more work and more processing time. The berry must ripen on the vine, and then be allowed to ferment in water so that the outer skin can be rubbed off and removed. They are then sun dried as black peppercorn.
Note: Pink peppercorns are a different species!