The PanCam (Panoramic Camera) comprises a stereo pair of cameras that sit ~50cm apart on what is called an optical bench. Together they can provide stereo 3D images that can be used to determine the distance that objects are away from the Rover.
The PanCam is mounted on a Pan and Tilt mechanism that allows it to be swivelled so that images with a sweep of 360 degrees can be created. This is done by taking a stereo picture, rotating the camera a few degrees, rotating it a bit more, taking another image and so on, until a set of images covering the full 360 degrees has been achieved. The images can then be stitched together to form a 360 degree panorama by the software tools. These images can then be viewed in 3D if you have the right kind of equipment.
Each PanCam has a set of filter wheels that enable scientists to select only certain frequencies of light when taking images (e.g. Infra-red, Ultra-violet, red, green, blue etc). This can be used by scientists to provide information about the composition of items in the image e.g. what kind of rock, sand etc.