We study the cohomology of certain Galois gerbes over number fields. This cohomology provides a bridge between refined local endoscopy, as introduced in Kaletha (Ann Math (2) 184(2):559–632, 2016), and classical global endoscopy. As particular applications, we express the canonical adelic transfer factor that governs the stabilization of the Arthur–Selberg trace formula as a product of normalized local transfer factors, we give an explicit constriction of the pairing between an adelic L-packet and the corresponding S-group (based on the conjectural pairings in the local setting) that is the essential ingredient in the description of the discrete automorphic spectrum of a reductive group, and we give a proof of some expectations of Arthur.