A histogram shows how the 256 possible levels of brightness are distributed in an image. It could be compared to a horizontal line with 256 positions which represent all levels of brightness from pure black (0) on the left, to pure white (255) on the right.
Pixels of the same brightness are stacked together on the vertical axis. The higher the line coming up from the horizontal axis, the more pixels there are at that level of brightness.
A histogram can show if there is enough detail in shadow, midtone and highlight areas of an image. An image that uses the entire dynamic range of the camera will have a reasonable number of pixels spread out over all levels of brightness.
Low contrast images will have a narrow basis with many pixels stacked together in the midtone area, while a high contrast image will have high levels of black and white and fewer grays. RGB images have a separate histogram for each color.
In Photoshop the “levels” command will allow you to adjust tones in shadow and highlight areas. By dragging one of the three triangles on the horizontal axis to the left or right, various areas of brightness can be lightened or darkened independently without affecting other parts of the image or losing detail.