Union determination

This is probably a silly question but how is it determined what union you’re a part of? Are some positions all PEF/CSEA/MC or is it by agency or something else?