If you take a length of copper wire at the same temperature, then the average kinetic energy of an electron, and therefore electron density, is the same through out the wire, balancing the metal ion density. The copper wire is electrically neutral at every point on average.
Now heat one end. This raises the average kinetic energy of electrons while reducing the electron density here, giving rise to an electron charge density gradient along the wire. The metal ion density meanwhile doesn't change much in comparison because of their much higher mass, and you no longer have cancellation of the electron and metal ion charge densities at each point along the wire. Hence you get a net charge density gradient along the wire, an electric field that opposes any further average diffusion of electrons at every point at equilibrium, and therefore a voltage across the ends.
It turns out that the voltage you get across the ends depends upon the type of metal you use because of its physical properties. Obviously, this is going to influence how mobile the electrons are, and their eventual density in equilibrium when you heat one end.
So upon connecting two different wires in series but heated at the junction, you'll get a net voltage at the other ends maintained at the same temperature, because the voltage across the ends of each wire are different.