Because the packets aren't sent over both links. A connection between two endpoints on both sides of the switch always uses only one link. Which one is usually determined by a hashing algorithm. If a link goes down the hashing algorithm sends the packets over the remaining links.
The hashing algorithm (there are multiple that can be used) can take multiple factors into account (common are source and destination IP and port, but there can be more). This ensures that answer packets reach the source via the same link the outgoing packets used and adds load balancing as another benefit.
For more details a good keyword for an internet search is link aggregation
.