By simple application of V = IR, there must be higher voltage drops across larger resistance. However, V is the integral of E multiplied by displacement. Thus, the electric field must be larger at places with higher resistance.

My question is how does the battery "know" where these high resistance places are and create higher electric fields there. It seems that if there is no wire connected, the battery will produce some electric field. Then when wires are connected, the electric fields will shift such that higher resistance portions will have higher electric fields. Why is this?