EtherChannel works by grouping multiple physical Ethernet links between two network devices (usually switches) into one logical interfaced called a Port-Channel. This logical interface behaves just like a single physical link, which simpliefies configuration and allows traffic to be balanced across all the physical cables in the group.
To set up EtherChannel, the links must meet certain conditions. They must all have the same speed and duplex settings, and they must belong to the same VLAN if operating in access mode (as opposed to trunking mode) (StudyCCNA.com). Once these conditions are met, the switch combines them into a single EtherChannel.
EtherChannel can be configured manually or dynamically through negotiation protocols to ensure both ends agree on bundling the correct links. The two main protocols are PAgP (Port Aggregation Protocol), which is Cisco proprietary, and LACP (Link Aggregation Control Protocol), which is an open standard defined by IEEE 802.3ad. PAgP has two modes: Desireable, where the device actively tries to initiate the channel, and Auto, where it passively waits for the other device to start negotiation. An EtherChannel will form if one side is set to desireable and the other is either desireable or auto. However, if both sides are set to auto, no channel will form since neither initiates the negotiation (Cisco Configuration Guide). LACP is similar in that it helps devices negotiate EtherChannel configurations. LACP supports up to 16 physical links in a group, with eight active links and eight standby links that automatically take over if an active link fails. LACP operates in two modes: Active, which actively tries to form the chanenl, and Passive, which waits for the other device to initiate negotiation. An EtherChannel will form if at least one side is in active mode and the other is either active or passive. The main difference between these two protocols is that PAgP only works with Cisco devices, while LACP is supported across a variety of vendors and equipment.
Switches use load balancing to decide how to spread traffic across the links. This is often based on information like the MAC address, IP address, or TCP port numbers. When multiple data flows occur simultaneously, EtherChannel efficiently spreads the traffic to avoid overloading any of the links.