The force of friction depends on the types of surfaces involved and how hard the surfaces push together. It does not depend much on the surface area of contact, although in general a smaller surface area experiences less friction than a larger one. For example, a book lying flat will have less friction than when it is turned on edge, because the weight of the book is spread over a smaller surface area.
All materials have some sort of surface roughness, even if they look smooth to the unaided eye. At a microscopic level, metals, for example, have bumpy and uneven surfaces. These mountains and valleys interconnect whenever the surfaces are rubbed against each other, and they attract each other with adhesive forces. The strength of these forces, called adhesion, varies with the substances involved; sandpaper has very high adhesion, while wood or steel have low adhesion.
Friction always opposes motion or attempted motion between surfaces, but the amount of friction varies depending on the conditions. Walk across a concrete sidewalk on a dry day, and you may slip, but if the same sidewalk is covered with water or oil (lubricants), it will be easy to walk.
If an object is resting, and a force is applied to try to make it move, the friction will increase until it overcomes the normal force, which is equal to and in the direction of the motion or attempted movement (called sliding friction). After the object slides, the friction will still be present, but it will be much less than the static friction.