“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.”
“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 the exact mechanism of transferring silica absorbed by the diatom to the cell wall is unknown. The science behind the extraordinary, highly uniform and often symmetrical deposition shapes - and their variations across species - is still a mystery.
Further reading at Wikipedia