Full range Herschel/PACS spectroscopy of the (ultra)luminous infrared galaxies NGC 4418 and Arp 220, observed as part of the SHINING key programme, reveals high excitation in H 2 O, OH, HCN, and NH 3 . In NGC 4418, absorption lines were detected with E lower > 800 K (H 2 O), 600 K (OH), 1075 K (HCN), and 600 K (NH 3 ), while in Arp 220 the excitation is somewhat lower. While outflow signatures in moderate excitation lines are seen in Arp 220 as have been seen in previous studies, in NGC 4418 the lines tracing its outer regions are redshifted relative to the nucleus, suggesting an inflow withṀ 12 M yr −1 . Both galaxies have compact and warm (T dust 100 K) nuclear continuum components, together with a more extended and colder component that is much more prominent and massive in Arp 220. A chemical dichotomy is found in both sources: on the one hand, the nuclear regions have high H 2 O abundances, ∼10 −5 , and high HCN/H 2 O and HCN/NH 3 column density ratios of 0.1−0.4 and 2−5, respectively, indicating a chemistry typical of evolved hot cores where grain mantle evaporation has occurred. On the other hand, the high OH abundance, with OH/H 2 O ratios of ∼0.5, indicates the effects of X-rays and/or cosmic rays. The nuclear media have high surface brightnesses ( 10 13 L /kpc 2 ) and are estimated to be very thick (N H 10 25 cm −2 ). While NGC 4418 shows weak absorption in H 18 2 O and 18 OH, with a 16 O-to-18 O ratio of 250−500, the relatively strong absorption of the rare isotopologues in Arp 220 indicates 18 O enhancement, with 16 O-to-18 O of 70−130. Further away from the nuclear regions, the H 2 O abundance decreases to 10 −7 and the OH/H 2 O ratio is reversed relative to the nuclear region to 2.5−10. Despite the different scales and morphologies of NGC 4418, Arp 220, and Mrk 231, preliminary evidence is found for an evolutionary sequence from infall, hot-core like chemistry, and solar oxygen isotope ratio to high velocity outflow, disruption of the hot core chemistry and cumulative high mass stellar processing of 18 O.