By dividing the heap into regions to collect incrementally.
G1GC divides the heap into multiple regions and collects garbage incrementally from these regions. This design allows G1GC to focus on the regions with the most garbage, minimizing pause times and making them more predictable. In a scenario where an e-commerce app experiences a sudden traffic spike, G1GC helps manage memory without long pauses.