How does a resistor "know" to increase the potential difference across its ends? My book says that current has to be constant throughout a simple series electrical circuit consisting of wires, a cell and few resistors, and hence resistors have higher potential difference across them than the rest of the wire with lower resistance.
How does the circuit "know" that it has to maintain a constant current? How does it know that it has to increase the potential difference across it? I know that potential difference in a circuit is the energy dissipated in the resistance, and with more resistance, more is the potential difference due to Ohms Law. But why does the current not just flow through the resistor, experience same potential difference as any other two points in the circuit with lower resistance, meaning that it will have less current flowing through it?
 A: When the voltage over a circuit changes, the change will propagate through the circuit. During a very short time, the voltages and currents will fluctuate, and the current can even differ along a conductor. But quickly the voltages and currents will find an equilibrium according to the different parameters of the circuit (like resistances and voltages of power sources). In that the laws of electricity (Kirchhoff's and Ohm's laws) are satisfied.
A: You are referring to transmission line effects. Things such as reflections, oscillations, ringing, and voltage spikes that occur whenever there are changes/transients in the circuit. This includes things like connecting power up to an otherwise DC steady state circuit.
These unsteady state signals bouncing back and forth between components of the circuit is effectively different parts of the circuit communicating with each other to reach an equilibrium.
A: (a) "How does the circuit "know" that it has to maintain a constant current?"
If the current (rate of flow of charge) wasn't the same all round the circuit, then electric charge would be piling up at some point or points. This couldn't go on happening for long because the piled-up charge (negative, let's say) would prevent (by repulsion) further charge charge from joining the pile. In a very short time after completing the circuit, the current will be the same all round the circuit, so the charge going into a segment of conductor per second will be the same as the charge leaving it.
This steady-state current will be determined by the pd provided by the power supply, and the resistance of the circuit. [You seem to be happy with this.]
(b) "How does [the circuit] know that it has to increase the potential difference across [a component with higher resistance]?
In my opinion this is quite a deep question –  if you don't want simply to be told that $V=IR$. I believe that the answer is along these lines... When I talked in (a) about piling up of charge, I didn't say that the piles went away, just that they were self-limiting. I think that (surface) charges on the conductor are responsible for the different pds across the different components. But we are in territory into which few venture, least of all writers of textbooks.
A: I believe you've got the title question backwards, and are ignoring the definition of resistance. Let's examine resistance first.
Resistance for a simple resistor is a ratio of the energy absorption per charge to the rate of charge flow, i.e., potential difference/current. But you know that. The conceptual difference, however, is that the resistor doesn't "know" anything. It absorbs energy, and the faster you shove charge through it, the more energy per charge it consumes. Also, the resistors cannot consume more energy than is put into the field by the source cell.
Now, the question you ask later is better, but the circuit doesn't "know" either. It's simply a matter of how the physical universe works. The equal currents through each series resistor is due to the conservation of charge, due to the gauge invariance of the electromagnetic field which drives the circuit. Basically, the charge continuity equation,
$$\frac{\partial \rho}{\partial t} + \nabla\cdot\vec{J} = 0,$$ tells us that if there is no accumulation of charge (a time change of charge density, $\rho$) the spatial derivative of current density must be 0. Since resistors don't store charge, the current through series resistors must be the same.
You can develop the continuity equation from Maxwell's equations.
A: 
How does the circuit "know" that it has to maintain a constant current?

When physics textbooks talk about how electricity works, they are generally talking about how steady-state electricity works, although they often don't explicitly state that assumption. All real-world electronics components have some capacitance, so when the voltage changes there will be differences in current, but those differences will last milliseconds. Once an equilibrium is reached, the current will be the same throughout the circuit because otherwise there would be a buildup of charge.
Remember that the current out of one bit of the circuit is the current into the next bit. If there's less current coming out of the resistor, then the part of the circuit after the resistor will have to have less current (unless it previously had a buildup of charge that it's discharging). One analogy for electricity is water. The amount of water flowing through one section of pipes has to be equal to the flow through the next. You can't make water appear out of nowhere.

How does it know that it has to increase the potential difference across it? [...]  and with more resistance, more is the potential difference due to Ohms Law

You can write Ohm's law as $V = IR$, but that is somewhat misleading, as voltage is not caused by resistance or current. Current is cause by voltage, and resistance determines how much. You're phrasing it as if more resistance causes more voltage. That's not the case. The resistor isn't increasing the potential difference across it, it is reacting to the potential difference that the EMF is creating. Writing Ohm's law as $I=V/R$ is in many ways a less misleading form, as it better represents the causal direction. For instance, in a circuit driven by a battery, the battery supplies a voltage difference. That causes there to be a voltage difference across the resistor, and the higher the resistance is, the less current flows. You can't reduce the voltage by reducing the current.
