The silicified cell walls of diatoms have inspired the interest of researchers for several centuries, and our understanding of their properties and formation has developed in synch with the development of observational and analytical techniques. Over the past 20 years, approaches used to characterize the molecular components involved in cell wall silicification have evolved, and this has provided significant insights into fundamental aspects of silicification, and promises to continue to do so."
Source : Understanding Diatom Cell Wall Silicification—Moving Forward Frontiers in Marine Science journal
In the last decade great progress has been made in understanding the conserved molecular mechanisms involved in silicic acid polymerization. Silica structure formation takes place inside a membrane-bound compartment, the Silica Deposition Vesicle (SDV)"
Source : Scientific Reports, Nature, 2017
The 'shells' are made made from silica extracted from seawater in the diatoms' Silica Deposition Vesicles (SDV).
But despite recent progress, the exact science behind the extraordinary, highly uniform and often symmetrical deposition shapes (and their variations across species) is still largely unknown.
Further reading at Wikipedia