Liquid-liquid phase separation (LLPS) of intrinsically disordered proteins (IDPs) is involved in both intracellular membraneless organelles and extracellular tissues. Despite growing understanding of LLPS, molecular-level mechanisms behind this process are still not fully established. Here, we use histidine-rich squid beak proteins (HBPs) as model IDPs to shed light on molecular interactions governing LLPS. We show that LLPS of HBPs is mediated though specific modular repeats. The morphology of separated phases (liquid-like versus hydrogels) correlates with the repeats’ hydrophobicity. Solution-state NMR indicates that LLPS is a multistep process initiated by deprotonation of histidine residues, followed by transient hydrogen bonding with tyrosine, and eventually by hydrophobic interactions. The microdroplets are stabilized by aromatic clustering of tyrosine residues exhibiting restricted molecular mobility in the nano-to-microsecond timescale according to solid-state NMR experiments. Our findings provide guidelines to rationally design pH-responsive peptides with LLPS ability for various applications, including bioinspired protocells and smart drug-delivery systems.