The potential profile is given by the dielectric response of the material in the central/scattering region, as well as by the boundary conditions imposed on the boundaries between the electrodes and central region.
For metals, the potential is flat across the central region, since ideal metals fully screen the electric field, i.e., it is zero in metals, whereas it is linear for insulators, which have a finite dielectric constant. In reality, the central region is a kind of in-homogeneous material, in general, and the dielectric function has a spacial dependence, meaning that the potential profile is in-homogeneous accordingly.
I would suggest reading some textbooks on the electrodynamics to understand this issue, i.e., Electrodynamics of Continuous Media
by L.D. Landau & E.M. Lifshitz., or any other book.