The reaction sequence involves conversion of terephthalic acid to the corresponding diamide using ammonia and heat. This is followed by the Hofmann bromamide reaction using Br$_2$/NaOH, which converts the diamide to the corresponding diamine — benzene-1,4-diamine (para-phenylenediamine).