It is better than a nail because of the spiral that makes it easier to put into walls.
The screw is better then the nail because of the fact that it can turn rotational force (in the form of torque) in to liner energy. This transition of energy is called mechanical advantage. On top of that a screw can hold together light weight objects with a low coefficient of friction because of its threads.