Sump pumps are not the ideal way to keep a basement dry. For one thing, they require a sump, so you always have some water/moisture in your basement. Secondly, the pump requires power. If the power goes out, you have a problem.
A better solution is a French drain or foundation drain (consisting of a perforated pipe surrounded by crushed stone that is wrapped in filter fabric) at the base of the foundation outside of the house. This drain is then connected to a low point, such as a catch basin in the street.
A French drain actually lowers the water table immediately outside the house. No water outside means no water inside.
If you have a French drain that works, you likely won’t need a sump pump at all, and your basement will still be dry.
Over time, though, even a well-designed French drain can clog up or otherwise fail. In these cases, water will then appear in the basement. In such a case, the fix is sometimes to then add a sump pump, as that is often cheaper than excavating to repair the French drain. Many older homes have sump pumps, either because they never had a French drain, or because it failed some time ago in the past.