Sometime you run a java program with a SecurityManager installed, sometimes not. If there is one, then you usually need a .policy file. The policy file constrains what different parts of the java program are allowed to do, e.g. it may or may not be allowed to read or to write files on the file system, open a socket to particular machines and ports, access system properties and so on.
The way it works is that you grant a list of priviledges to certain "code sources", normally specified jar files and class directories. You can also specify digital signatures for grants. The policy file consists of grant blocks.
It's a fairly complicated system, because if less privileged code calls more privileged code then the lowest priviledges normally apply, unless the more priviliged code determines otherwise.