No one wants to find water in their basement. This can mean expensive foundation repairs are needed, or at least basement waterproofing by professionals (also expensive).
But there are a couple of things homeowners can do to help prevent water in the basement.
Downspouts
The first thing to do is to make sure all your downspouts are working properly and taking the water away from the house. If you're missing the bottom piece on any downspouts and dropping water directly beside the foundation, you're dramatically increasing your chances of water getting into the basement. Even a new foundation wall on a brand new house runs the risk of water penetration if you put enough water down beside it. Downspouts should have the curved piece at the end and enough extension to take the water out and away from the house.
This includes if you have an older house that has downspouts going into the ground. These downspouts will be tied into the weeping tile, which is a drain system around the base of the foundation. The idea is that the water will go out to the storm drain. The biggest problem with this is that old weeping tiles were made of clay and are prone to break-down over time. This means a weak spot in the system that could allow water into the basement rather than taking it away. This is why home inspectors will always note downspouts going below ground and recommend disconnecting them and extending them away from the house. (and of course plugging the pipe going down)
Grading
The second thing to look at is grading. The ground around the home should have a gentle slope away from the house. If there are any spots where the ground runs down toward the wall or there's a hole or dip in the ground, these are places where water could easily pool and overwhelm the foundation's drainage system, regardless of the age of the home. I've been in a brand new multi-million dollar home where they had left a huge hole in the ground beside the foundation and there was a rather significant leak when I showed it the day after a rainstorm.
The fix is relatively simple - get dirt and make sure the ground slopes down away from the house, without any dips that would allow water to collect beside the house. It doesn't have to be a noticeably sharp 'ramp', just a gentle and consistent slope down and away. There are varying guides, but it should be about 6 inches for the first 10 feet where possible or roughly an inch per foot. A good home inspector should also be able to identify these potentially problematic areas and give some guidance.
Taking care of downspouts and grading may not prevent all chances of a wet basement, but many cases of basement dampness or leaks will be prevented by taking care of these two areas.