Its quite simple.
Data passed into nest.entries has a format of [{date: 'mm/dd/yy', key: 'GroupX', value: 37}, ..... ]
nest.entries just groups the data by "key". Example: [{key: "GroupX", values: [{date: 'mm/dd/yy', key: 'GroupX', value: 37}, {date: 'mm/dd/yy', key: 'GroupX', value: 32}....]}, .... ]
Then the result of nest.entries is passed to the "stack" function instantiated via d3.layout.stack(). The stack function calculates the baseline (y0) depending on the kind of offset you have chosen (one of "wiggle", "silhouette", "expand" or "zero") and copies the "value" of the particular value in the nested data to "y". By default the offset is "zero", so y0 begins with 0 as its value for the base layer. The layers above it will have the value of "y" (of bottom layer) as the y0 value (this is how the stacking is done -> y of the bottom layer becomes y0 of the layer above it).
Example: [{key: "GroupX", values: [{date: 'mm/dd/yy', key: 'GroupX', value: 37, y: 37, y0: 0}, {date: 'mm/dd/yy', key: 'GroupX', value: 32, y: 32, y0: 0}....]}, {key: "GroupY", values: [{date: 'mm/dd/yy', key: 'GroupY', value: 4, y: 4, y0: 37}, {date: 'mm/dd/yy', key: 'GroupY', value: 32, y: 5, y0: 32} ].
To verify my answer you can log the data object to the console. You'll understand much better that way.
How does stack compute the values for y and y0? Magic? Nope! You have defined it here:
stack.values(function(d) { return d.values; });
stack.x(function(d) { return d.date; });
stack.y(function(d) { return d.value; });
y0 is calculated when you call stack(nest.entries(data)).
And the d3.svg.area generator takes care of constructing the path for generating the layers:
area.x(function(d) { return x(d.date); })
area.y0(function(d) { return y(d.y0); });
area.y1(function(d) { return y(d.y0 + d.y); });
Always think of these generators as corresponding to a single layer/path and subsequently as points within these layers (x, y0 and y). So the above function generates a layer with points mapped to x-axis via function area.x and the baseline defined by function area.y0 and the height defined by function area.y1 (which is y(d.y0 + d.y)).
Then the rest is really easy to grasp. Just pass the domain extents for x and y. Do the awesome d3 data-join stuff with svg.selectAll('.layer').data(layers) and append 'path' (layer) with its 'd' attribute being 'area(d.values)' ( remember that you are now passing "layers" object and not your original "data" object. So the "values" here is computed via "stack(nest.entries(data))" )
Hope this helps.