If a Resource Cache Capture attempt is successful, any surviving Units will remain at the Cache and gather Resources. When gathering is complete, they will automatically return to your Base with Resources.
If, after Units are sent to a Cache, the Cache disappears from the Map, all Units will return to your Base. This is also the case if Attack or Recon missions are carried out on a Cache that becomes vacant while those Units are travelling there.