Up until the 2008 NEC code cycle 3 wire feeders were permitted if there were no metallic paths between the two structures. From 2008 and beyond a 4-wire feeder is required. If there is an old 3-wire feeder you must bond the neutral just like in a service and connect the GEC from your grounding electrodes to the neutral.
With a 4-wire feeder the EGC’s and neutrals are separate and the GEC goes to the EGC bus which is bonded to the enclosure, the neutral is left floating.