An InsideEV article from nearly a year ago is a great help in figuring this all out. It reports on comments J.B. made at a presentation he gave at an SNE conference in 2016.
Tesla CTO J.B. Straubel: 30% Increase In Battery Energy Density From Model S To Model 3 - Video
Reading this piece it is clear that confusion between increases in cell energy density and over all battery pack energy density improvements is very easy. It makes it clear that for M3 the cell density improvements are the major driver of energy density considered at the pack level. I'll show several quotes from the article to illustrate.
1. Straubel also made it clear that there are no monumental “battery breakthroughs” occurring, nor does Tesla or others rely on this. Instead, there is a steady and constant improvement. Batteries improve at least 5% a year.
2. [This will continue to be the case over time,] so it only makes sense that the Model 3 will have an energy density increase over the Model S. J.B Straubel announced that the Model 3 will boast 30% more energy density than that of the original pack in the Model S. He said (
quote from video below, via Electrek):
“These batteries are steadily improving every single year – maybe around 5% improvement in their energy density their ability to store energy in a given amount of mass. That’s probably one of the key metrics we worry about. And when we went from the Roadster to the Model S, they have improved by about 40% and when we were designing the Model 3, they were about another 30% better. That improvement just continues on every single year in the background.”
While J.B. speaks of M3 boasting 30% more energy density than original pack in Model S, it's clear from his statements that batteries improve at least 5% a year, year in and out. It is these many non major cell level improvements that are mostly responsible for the 30% increase for the M3 pack as a whole.
We know that the change in cell form factor allowed more individual cells to fit within the available pack dimensions vs the old form factor. That and design improvements saving some pack weight likely account for 5 or 10% of the pack level increase.