Dope each half of the bar and connect a battery. Electrons and holes drift, diffuse and recombine, while the band diagram below shows what the same carriers are doing in energy. Everything here is schematic: a handful of carriers stand in for 1017 per cm3, and the current follows an ideal diode law with a little series resistance.
Left region
Right region