How does a pinhole camera work?
Light passes through a small diameter hole (pinhole sized, thus the name) formed on the opposite wall of an image. The brightness will be proportional to the brightness outside. If the hole is not sufficiently small, light on the matte screen creates a circle of size proportional to the size of a pinhole. Therefore, increasing the diameter of the pinhole reduces the sharpness of the image. Reducing the diameter of the pinhole improves the sharpness, but reduces it's brightness.
By selection the hole size will let enough light inside the camera to illuminate the photosensitive material (for exmaple fim or photographic paper). Resulting image is different from the image produced by modern cameras as it's more blurry (soft).
Depth of field in pinhole photography: Angular magnification is constant for subjects located in any distance from the camera, so the depth of field ranges from zero to infinity.