Can two drives connected to a USB hub bypass the computer when sharing data?
If I connect two usb drives to an external USB hub and I copy data from one drive to the other, does the data go through computer? Or will the data be managed by the USB hub?
Does this have some performance benefit?
No, this won't work. All data you are copying will need to be read by the computer from the source drive, before they are copied to the target drive.
If anything, having two hard drives connected to the same USB hub might slow things down. If you have multiple devices connected to the hub, they have to share the bandwidth.
USB is a host-driven protocol, not a peer-to-peer standard like FireWire. Drives are just devices, they're not the host to control or decide anything. Without the host they cannot even interact with the outside world.
Assuming that you can connect the two drives like that then the drives still don't understand the file systems and don't know which files/folders you want to copy. They don't know where the blocks of the files are stored and don't know what to behave when unexpected things happens like when there are duplicated files or when drives are full
Devices connected to the computer through a hub can't talk to each other or share data within the hub; all traffic is between each device and the computer.
There is no performance benefit from connecting two drives to a hub, and there may be a performance detriment. The hub, itself, is connected to the computer through a USB connection, so everything connected to the hub has to share the capacity of the hub's computer connection.
Concurrent use of more than one drive connected to a hub as USB 2.0 [1] will generally exceed the USB 2.0 bandwidth of the hub's computer connection, potentially also affecting the performance of other USB 2.0 devices attached to the hub. This can happen even with a single USB 2.0 connected drive while actively transferring data.
[1]USB 2.0 connection includes USB 2.0 drives connected to any hub, or USB 3.0 drives connected to a USB 2.0 hub. On a USB 3.0 hub, USB 2.0 devices have a separate USB 2.0 data path with its own bandwidth limitation.