The cause of the potential barrier in a p-n diode is