Connecting polymer-surfactant interaction in solution with the structure on the interface: Interplay between electrostatic and hydrophobic forces