Why does Earth have two clearly differentiated kinds of crusts, namely continental and oceanic? How did they differentiate initially and why don't they get mixed up over time?
First they do get slowly mixed at the plate boundaries but the mixing is minimal compared to the amount of crust there is. They do not mix easily since they have different densities, they tend to separate out when melted so most mixing is done in their solid states.
An easy way to think of it is there is not enough continental crust to cover the entire planet so oceanic crust is filling in the gaps. A better analogy is to think of continental crust as scum on pond (or foam in a tub). The uppermost portion of the mantle and oceanic crust are basically the same thing, oceanic crust is just colder, while continental crust is different in composition it is lighter and floats on top but as I said there is not enough of it to cover the entire planet so like scum on a pond it forms clumps and gets pushed around by the underlying currents. And just like pond scum they separate out because they have different densities than the "water" so they collect on the surface.
Continental crustal material is just sligtly less dense than basaltic rock because when heavier basaltic rock is subducted under the continents and melts once again, the lighter such elements like aluminum and silicon on the otherhand tend to move upward and the heavier elements and minerals like Iron migrate down. That makes for the iron-rich portions on the other hand are being recycled back into the mantle and the silicon rich rocks ascending to the surface. Volcanic eruptions that occur above the ocean may deposit new basaltic rock in turn weighing down continental plates but it's continuous activity however granite's higher melting point means more weight must be contributed