HBr is composed of a hydrogen atom and a bromine atom. Bromine is a nonmetal, and when it reacts with hydrogen, its electrons are transferred to the hydrogen atom, resulting in the formation of H+ and Br- ions. These ions are then attracted to each other to form an ionic bond, resulting in the formation of HBr.