A young planet grows like a snowball rolling down a slope: countless small pebbles from the surrounding gas disk stick to it. The larger it gets, the stronger it pulls in gas — hydrogen and helium. A dense, hot envelope forms around it. Pebbles falling through it heat up from friction and their own weight, like grains of sand falling into thick honey. Some of them melt, and volatiles (zinc, sodium, potassium) evaporate.
This envelope is not airtight: gas constantly leaks back into the surrounding disk, carrying away the evaporated substances. Scientists calculated that the loss of volatile elements depends on the mass of the growing planet and on how quickly its gaseous shroud is replenished. If the atmosphere lingers for only a few centuries, noticeable zinc loss begins for planets with a mass of about 0.4 Earth masses, and sodium and potassium loss at about 0.6. Lighter planets barely lose these elements.
This scenario explains why the inner planets of the Solar System (Mercury, Venus, Earth, Mars) contain fewer volatile elements than the Sun itself. It turns out that the future Earth was losing zinc and potassium even before it became a full-fledged planet.
The zinc and potassium in Earth's crust today are just leftovers: a significant portion evaporated from the young Earth's surface while it was still growing in the gas disk.