In UBL (and some other formats, like CII and EDIFACT) some objects reference to other objects using well-defined identifiers. For UBL and CII, this identification is done on the <ID> and <Code> elements (UBL uses the same elements as CII for this), in EDIFACT this may be done in a different way.
The <ID> element uses scheme* attributes. The <Code> element uses list* attributes. The identifier resolution starts at UN/ECE 3055, which defines the agencies.
The id of the agency listed in UN/ECE 3055. So ISO will have value 5 and UN/ECE will have value 6. See https://service.unece.org/trade/untdid/d24a/tred/tred3055.htm for all values.