How do electrons "know" to share their voltage between two resistors? My physics teacher explained the difference between voltage and current using sandwiches. Each person gets a bag full of sandwiches when they pass through the battery.  Current = the number of people passing through a particular point per unit time.  Voltage = the (change in) number of sandwiches per person.  In a parallel circuit the number of people (current) is divided between the two paths, but the number of sandwiches per person (voltage) remains the same.  In a series circuit the number of people passing through a particular point remain the same, but they drop off a certain percentage of their sandwiches at every resistor.   Therefore, there is a voltage drop that occurs between the points before and after every resistor.
This analogy naturally leads to the question: how do the electrons "know" that they are going to have to share their voltage between two resistors before they reach the second one?  (In other words, not drop off all their sandwiches at the first resistor they find)
 A: These laws are based on a circuit in equilibrium. If you made a circuit where you had +1 volt on the left, 1 ohm in the middle, and +2 volts on the right, and you started out with the resistor not under any voltage, electricity would start out moving towards the center of the resistor until it builds up a voltage of about 1.5 volts. (It would gradually change from 1 volt to two based on which source you're closer to.)
If you want to extend the sandwich analogy, imagine, for some reason, that the strength of people is proportional to their sandwiches. They also have no idea where they're going, and they push at random. And the number of sandwiches they drop is proportional to their speed.
In my circuit, at first people will be pushed by the people behind them, until they get to the center. At this point, the guys on the right have more sandwiches, so they shove the people on the left back, until you end up with just a group of people going from the right to the left. They're slowed down exactly enough to have one sandwich at the end, since if they went slower, they'd have more sandwiches than the guys they're pushing against, speeding them up. If they went faster, they'd have fewer, slowing them down.
The reason you always end up with everyone having the same number of sandwiches when they meet at a node is if they don't, the guys with more sandwiches push back on the guys with less, slowing them down, until they end up having the same number of sandwiches. It might be off for a little bit, but it will quickly enter an equilibrium.
A: BEWARE THE SANDWICHES!!!
:)
In the spirit of math-avoidance sandwich-juggling, here's a better analogy, a visible one.  The movable charges within conductive circuits are like silver bead-chains, like those little chains which attach the pens to desks in old-school banks.  (Growing up I always played with these when mom was in the teller line.  Do those bank-pen chains even exist anywhere?)
Obviously these bead-chains can transmit pulling-forces like any chain.  But they also can transmit "push," if we compress the chain so all the beads are lined up and touching together.  Electric circuits do both, and so do the bead-chains.
Make a drive-belt using a loop of bead-chain, with two pulleys, and two pipes.  (The chain is inside the pipes, so the beads are forced into a straight line.)  Now turn the drive-wheel.  It compresses one side of the chain-loop.  The solid column of beads grows outwards, and you can watch the wave move along to the far wheel.  The drive-wheel's rotation also yanks on the other half, and that side of the chain will progressively un-compress.  A wave propagates along both halves of the chain-loop, from drive-wheel to driven-wheel, and when the waves arrives at the driven wheel, that wheel turns also.   Reverse the drive-wheel, and the waves still go in the same direction, going from drive-wheel to driven-wheel.
Note that these chain-waves move much faster than the beads themselves (the electrons.)  Also, the waves move along both halves of the loop, going in just one direction from the "generator" pulley to the "motor" pulley ...while the chain itself moves in a complete circle, with half of the loop going backwards against the wave.
The wave is the joules.   The chain is the coulombs.   The speed of the chain is the amperes.
So, there's your answer.   The drive-wheel "knows" what's on the far end because the beads stack up on one side and produce back-pressure.  The drive-wheel can "feel" the distant driven wheel, feel whether its free, or stalled, or resisting.  And on the other side of the circuit, the beads all pull upon each other.  So, any resistance at the driven-wheel becomes known to the whole chain, regardless of which direction it's rotating.
Note that both halves of the beads-circuit are transmitting energy.   There's no "return wire" filled with useless "empty children" which carry no sandwiches.
Note that electrical energy is a wave, and the row of charges are the medium through which it propagates.  (And, the entire circuit comes pre-filled with charges.)   The slow speed of amperes and the fast speed of wattage is mysterious unless we realize that electric circuits are a wave-and-medium situation.  Of course the medium moves slow.  Usually the medium doesn't move forward/backward at all, instead it just vibrates, while only waves actually "flow" ahead.  The electrons in wires are a medium for propagating waves, and the waves are the electrical energy.  The energy doesn't stick to individual electrons like tiny sandwiches might.  Without this key insight of wave-and-medium, we'll always end up with some confusion about watts versus amps, and about joules versus coulombs.
For AC circuits things are much clearer: the coulombs wiggle back and forth, while the joules move continuously forward, it's waves moving through a medium.  Unfortunately many grade-school textbooks (and your teacher) ignore all this, and try to teach circuits based on DC, where all of the fast-moving wave-energy becomes completely smooth and invisible.   No, the batteries and bulbs are not simpler. Instead use AC generators with bulbs.  That way the slow vibration and the fast waves become a major issue.  Or, at least use a DC hand-crank generator instead of a battery.  And then wiggle the handle violently back and forth to light the distant bulb.
Try doing the "sandwiches" with an AC circuit, and you'll see how it all falls apart.
The sandwiches don't work, since the electron-current in metals is a very slow flow, yet the lights turn on instantly.  How did the "sandwiches" get there so fast, if the kids can only inch along at feet-per-hour rates?  The kids must be handing off; transferring rapid sandwiches between children all along the line!  And, for a proper circuit you'd need a complete circle of kids, with half of the kids facing the wrong way, and sending their sandwiches to the kid behind them.
When the two streams of sandwiches meet at the distant load, they're converted to heat.  We must make a big sandwich pile, and set them on fire.  Use all-meat subs with extra olive oil, they'd go up like a torch.  Keep it accurate though: as the pile burns, continuously deposit more sandwiches so it doesn't get any smaller.
A: Well, they don't know that actually. The picture you are familiar with is quite simplified. To explain the apparent emergent properties you need statistics and knowledge of microscopic physics. So what happens with that electron as it passes through the circuit? Well, let's start with resistors. Why is there any resistance at all? It's because electrons collide with the crystal lattice of the conductor and thereby lose energy (let me use this more familiar term instead of your sandwiches). How much? Well, it depends on precise realization of the collision. Some electrons scatter elastically (losing no energy at all, just changing direction of motion), some don't. But if you average this over all electrons (because there is so many of them in the material), you'll obtain the familiar Ohm's law for the heat losses.
Gaining of energy by electrons is pretty much same, but in reverse. There is a possibility that the electron will absorb a photon (which is a quantum of electromagnetic field) and this will boost it. Again, whether the collision is elastic or not doesn't matter. Once you average over all electrons and photons you'll be left with macroscopic effect of current produced by classical EM field.
A: Continuing Marek's reply, I will add that in  electrical circuits the value of the current depends on the elements of the circuit: the  voltage , the resistors summed when in series, summed inversely if in parallel. The whole defines the value of the current, and currents in the parallel parts, according to the electricity laws. The individual electrons participating in the current follow the flow, it is the current that "knows" where the resistances are . 
A: The question is ill-posed; the electrons "know" nothing, and voltage is not a property of the electron (other than e.g. charge, which is a property).
In fact, voltage is a pretty abstract concept; it is energy divided by charge. And that means explaining an abstract term by another abstract term. 
Let's be more fundamental: nature shows that charges exert forces on each other. Charges are conserved quantities, they are additive, and the force on a "test charge" is proportional to that charge. This leads to the concept of the electric field in electrostatics: the electric field is the force a test charge feels, divided by the charge. 
An analogy would be gravitation: here, a "test mass" feels an attractive force proportional to its mass, which is the reason we may talk about a gravity field.
Force times distance equals work. So in electrostatics, if you move a test charge Q between two points A and B in a field, there is work associated with it. And since the force is proportional to the test charge, the resulting work to move Q from A to B also is. So it is natural to speak of "work per charge", which is voltage.
The analogy in gravity is "work per test mass", and near the surface of the earth, where the field is uniform (acceleration g), the best known measure for that is height difference.
Taking the analogy further, it is useful to think of a "water stream" as analogue of the electrical current. Here, the amount (mass) of water is the analogue of charge, and the height (level) of the stream is the analogue of potential, and a delta in height is the analogue of voltage.
Note that there is no fundamentally defined, absolute value for potential, just as there is no absolute value for energy. It is defined up to an arbitrary integration constant. 
This is where the sandwich analogy clearly fails. Sandwiches are simply not something you gain or lose while going in a circle, unless the battery is constantly making sandwiches and the electrons are (in a resistor) eating up the sandwiches. But I do not see how this helps to explain voltages... 
A: Electrons move because they are in a region of space with a non-zero electric field. They don't accelerate to high speed in a wire because they keep bumping into things; a kind of friction which dissipates energy much like the friction you are used to that explains why resistors get hot. In effect their speed depends on the strength of the local electric field and the nature of the material they move in.
When you hook up a circuit of some kind to a voltage source (battery, generator, wall-wart, whatever), the electric field already present between the terminal of your power supply causes some electrons in the wires to move around. In the course of doing that the electric field gets re-arranged to point along the wires and through the components and so on. There is rather a lot of shuffling that goes on immediately after the power supply is hooked up and I am going to mostly ignore it to focus on what happens when a (short-term) steady-state is established.
Circuit basics
Observe the circuit in its operating state: the electric field points along the wires and though components in various way. In some places that field $E$ is weak and in some places it is strong, and in some places the electrons flow fast and in others slow, but there are two rules that must be obeyed:1


*

*The current (number of electrons passing a point) is the same throughout the circuit. This follows because I have restricted out consideration to time when things aren't changing, and if more were passing point A than point B (a little further down the circuit) electrons would be piling up in the space in between them.

*The total voltage change around the circuit has to be zero. This is because voltage is a function and can have only one value at any point in space, so if I follow any path that comes back to itself the changes has to equal zero when it returns.2
These rules are written in terms of voltage and current, but previously I was talking about electric fields, so what's the relationship between them?
The current comes into play in the form of Ohm's Law: $V = I R$.
The potential change in a section of circuit with length $d$ and constant electric field $E$ is $\Delta V = E d$, so we can write the voltage rule as
$ 0 = V_{ps} - \sum V_i = V_{ps} - \sum_i E_i d_i$ where $V_{ps}$ represents the voltage gain of the power supply.3 Rearranges this gives us
$$ V_{ps} = \sum_i V_i = \sum_i E_i d_i \,.$$
One last thing before we're ready to answer the question: the electric field in the wires is usually assumed to be very small compared to the electric field in other things like resistors. Therefore, we can ignore the $Ed$ contributions from the wires in working the maths. This isn't true for very long wires or for very fine wires under low voltages, but we're going with it anyway.
How do the electrons "know"
Consider a very simple circuit with a switch in it. A resistor (numbered 1) is connected directly to the battery and to the input of the switch. From the switch the current gets back to the battery either directly or through a second resistor (numbered 2). 
The circuit starts with the switch set so that only one resistor is involved. When we hook it up, the fields rearrange themselves such that we have very weak fields in the wires and a very strong field in the resistor: $V_1 = E_1 d_1 = V_{ps}$. To make the current rule work, we have a lot of electrons moving slowly in the wires and a few electrons moving very quickly in the resistor (think of car flowing).


*

*$t = 0$ The original state of the circuit has a field in resistor 1 $E_1 = V_{ps}/d_1$ and very weak fields everywhere in the wires. There is no build up of electrons anywhere and the current flow is steady throughout.

*$t = 0 + \epsilon$ The switch has changed state, but the electric fields have not re-arranged yet, so there is zero field in resistor 2. Electrons continue to move through resistor 1 at the same rate as before, when they get through it there is no field to move them through resistor 2. They begin to pile up between resistors 1 and 2. As they do that they begin to reduce the field in resistor 1 and increase it in resistor 2.

*$t = 0 + (2\epsilon)$ Now there is a little field in resistor 2 and a little less in resistor 1. Current has started to flow through resistor 2 but there is still less than is flowing through resistor 1. More charge is building up between them and that is driving the field in 2 up more and the field in one down more. 

*$t = 0 + (\text{several }\epsilon)$ The field in resistor 2 has risen and the field in resistor 1 has dropped until they are almost matched. Current flow through the 2 resistors is almost the same with only a small amount more coming through resistor 1. The charge between them has almost, but not quite stopped changing and that means the fields in them are also almost fixed.

*$t = 0 + (\text{many }\epsilon)$ The field in resistor 2 has risen high enough that it's current matches that in resistor 1. This represents the new current of the circuit as a whole and is lower than the original current. 
What we learn from this consideration is that any time the flow of electrons is faster through one part of the circuit than another, electrons will accumulate in such a way as to re-distribute the electric field in the circuit so that the flow is more even than before, and that this process happens continually until the flow becomes uniform throughout the circuit. The strength of the electric field is also related to the voltage change over each component and will be adjusted until the total is equal to the supplied voltage.

1 Rules written in a form that applies only to series circuits. For a more complete version, look up Kirchoff's Laws.
2 This is true when you neglect magnetic induction.
3 I am assuming that there is only one power supply. The full treatment of Kirchoff's laws can relax this restriction.
