As you saw with the voltage source model, to get a voltage we need two isolated opposite charges.
When two conductors in a circuit are close together, the current flowing
tries to get as fast as it can to its destination. Sometimes there's a
close enough distance between them that the charges get drawn there
instead of continuing along the length of the conductor, until they are
pushed out by other charges also trying to get close to their
destination.
In that situation, when the charges are just starting to build up, the
voltage across that point & the destination point, which from now on
we will call ground, starts to build up just as the charges build up.
This delay in the voltage is caused by a property called capacitance.
This property is exhibited whenever two conducting or charged layers are
separated by an insulating layer, forming what is called a capacitor.
The capacitance depends on various factors like the thickness of the
conducting material (thicker means it can hold more charge), the surface
area of the conducting layers (more area means more charges have a
close spot to the opposite layer) & the insulating ability of the
separating material (called dielectric)