RJ-45: It protects the computer, router, or switch from power surges transmitted through the Ethernet cable, preventing damage to network ports in case of lightning or disturbances.
USB: It acts as the "brain" of the connection, allowing the UPS to communicate with your computer's software in order to filter shutdown commands and protect your data from sudden power loss.