In a bilayer the charged head groups are in contact with the water and the fatty acid chains are in the middle of the bilayer. In water, bilayer formation is largely an entropic effect. In isolated phospholipids in water the fatty acid chain has to be bridged by the H-bonded water molecules as it is hydrophobic. This reduces the water molecules entropy vs that in pure water. Forming bilayers, or micelles, allows many individual lipids to free up many waters as the water is excluded from the centre of the bilayer. This is entropically favourable, i.e. entropy increases vs isolated lipids, and this gain is so large that it exceeds that entropy reduction of forming the bilayer. (The charged head groups are mainly just the same whether as individual lipids or as a bilayer.).
The water around the head groups has a high dielectric constant (relative permittivity = 80) which means that the electric field of any charge is reduced v rapidly vs distance away from the charge, approx as $q/80R$ for charge $q$ and distance $R$. Thus two charges can be close without any large repulsion. In a non-polar solvent such as hexane the dielectric constant is $\sim 2$ so v slow reduction in electric field and charges cannot come close to one another as repulsion soon becomes greater than thermal energy.