As Sandnukka15 said, you put your pump in the sump, and pump water up to the tank, water then falls by gravity back to the sump. The tank will only overflow if the drains on the tank are too small for the amount of flow (or not properly constructed), or if they get plugged (plants, dead fish, etc etc), or if after a water change, you get distracted and forgot you've left the water running, putting more new water in than the tank and sump can hold.
And there is another scenario, one which has happened to me.
I do like to keep my sumps fairly full, and if too full, in the event of a power outage, the tank drains by gravity to the level of overflows, if they are placed, and pull too much water, too far below the surface of the tank, that excess water can make the sump overflow.