The superposition principle is a property of a linear system/function/algebra. If the function f is linear, then if
[itex]A=f(a)[/itex]
[itex]B=f(b)[/itex]
then
[itex]A+B=f(a+b)[/itex]
This is the superposition principle and it works for any sort of linear or approximately linear problem. Electromagnetism and quantum mechanics are linear. More specifically, the electric field is a linear function of the charge distribution.
[itex]\textbf{E}(\vec{x})=f(\rho(\vec{x}))[/itex]
So, if you know the electric field for two charge distributions, you can easily figure out the electric field for the combined charge distribution.