Due to the electronegativity difference between carbon and oxygen / nitrogen, there will be a slight electron withdrawing effect through inductive effect (known as the –I effect). However, the other effect called resonance add electron density back to the ring (known as the +M effect) and dominate over that of inductive effect. Hence the result is that they are EDGs and ortho/para directors.
Phenol is an ortho/para director, but in a presence of base, the reaction is more rapid. It is due to the higher reactivity of phenolate anion. The negative oxygen was forced to give electron density to the carbons (because it has a negative charge, it has an extra +I effect). Even when cold and with neutral (and relatively weak) electrophiles, the reaction still occurs rapidly.