First of all, a pinhole lens separates itself from nearly every other lens on the market by not using any internal glass elements whatsoever. The only thing transferring light to the camera’s film or sensor is a tiny hole, which typically provides a dark and de-sharpened image. This presents many limitations during the photographic process, but can also grant a unique look.
Despite these drawbacks, pinholes hold an important place in the history of photography. This lens type was used by the first devices that could functionally be called cameras. The first recorded use of pinhole cameras dates all way back to ancient China, around 500 B.C (via UC Berkely). When combined with a rudimentary darkroom, it became known as a camera obscura. Users would place themselves inside the camera and be able to view an image of the outside world projected upside-down on the wall of the darkroom. About 1,000 years later, the camera obscura was commonly employed by Renaissance artists in order to view and trace realistic reference images (via BBC).
Around the same time, users began to realize they could flip the projection using mirrors, and that they could put glass elements in front of the pinhole to produce a higher fidelity image. Skip to the mid-1800s, and scientists were experimenting with photosensitive chemicals. Putting them behind the lens in order to capture the image projected by the camera obscura. Thus, the modern art of photography was born (via PBS).