On my current device (a Pixel 4 XL) USB functionality like MTP file transfer and ADB debugging is unreliable, with the device disconnecting after a random amount of time. On GrapheneOS this behavior happens every couple of minutes, with it improving to happening after a longer period of time if nothing has been running on the device for a while. On the stock OS it would happen every minute, and when I rooted the stock OS (before I moved to to GrapheneOS) and ran top on the phone noticed a process would be terminated the same exact time the USB functionality would fail.
On an older Pixel 3 device running the stock OS, this issue would happen several times every minute, to the point of being almost impossible to transfer anything off the phone.
However on a Pixel 6 device running the stock OS, the issue would never come up, even if the phone was running many other apps in the foreground and background.
This behavior would happen regardless of what USB port I would plug the Pixel 4 XL and Pixel 3 into as well as regardless of what cable I would be using, even with the original cables the phones came with. It would also happen on multiple different PCs and laptops.
Is there a technical reason for why this behavior occurs, and why it did not seem to occur at all on the Pixel 6?