Up to and including OS X Tiger, we could group handy collections of shortcuts to different folders under a single item in the Dock. Some people used this to give them ready access to folders spread across several volumes, for example.
Leopard (OS X 10.5) replaced this with Stacks, which were only improved to support hierarchical structures in OS X 10.5.2. However those still did not support folder aliases. At least two third-party utilities, HierarchicalDock and Quay, restored the flexibility that we had before Leopard.
Although Snow Leopard (10.6) revamped the Dock’s appearance, it did not restore this feature, and we had to wait for Lion (10.7.2 at least) to do so. Quay has been maintained to support versions of OS X up to and including Mavericks, as it still offers greater flexibility and capacity than the standard Dock does.
With Yosemite (10.10), all in the Dock is rosy again.
To use this feature, make a new folder and place within it aliases to the different folders that you want to access from the Dock. Drop that folder into the Dock, to the right of the vertical bar, between it and the Trash. You can set its options, for example to open the Dock item in a fan as shown.
Who knows how this might change when El Capitan is released?
Thanks to Richard Hallas for drawing my attention to this.