When you focus your camera on a particular subject, other objects some distance in front of and behind the subject will also be in focus. The relative distance of these in-focus objects either side of the focal point is called the depth of field. Exactly how far in front and behind your subject will remain in focus can be controlled by altering the aperture setting of your lens. I've already covered the basics of how this works in a previous tutorial, so I'd recommend reading that article now before proceeding any further with this one.
In landscape photography you generally want to have as much of the scene in focus as possible, so it's normal to use a very small aperture setting to maximise depth of field. However, simply maximising the depth of field won't ensure that your entire picture is in focus. You also need to know where to focus your lens. If you set the focus too close, then the foreground and middle-ground will be within the depth of field, but distant objects will be blurred.
Most digital cameras, especially compacts, have an automatic landscape mode, which will normally set the focus on infinity and select a narrow aperture. In other cases people will rely on the camera's autofocus system for landscape shots, but this amounts to the same thing, since the camera will normally focus on the extreme distance. However in this case objects in the foreground may be outside of the depth of field, and will be blurred.