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.