Dr. Gamer, a beetle researcher at the British Museum of Natural History, has a nice blog post which illustrates what natural history collections do, using tiger beetles as an example.
Natural history collections in general are a repository for physical specimens, whether biological, geological, or anthropological. These objects are collected by researchers at the museum or donated by experts working in the field. A particular collection may have a local or worldwide scope, and may specialize in a particular group of organisms or topic, depending on the past interests of researchers connected with the collection. The objects or specimens are organized in a way that makes them easily retrievable for future research (such as a general reference system).
At some point a researcher will either come to the museum and look at these specimens, or request a loan. When the loan is returned, it's expected that the specimens will have some value added to them. Perhaps information about where they came from, or species identification. Either way, the objects are returned to the collection and add to its overall value.
This is the natural history collection (and natural history research) cycle in a nutshell: Collect specimens; Organize specimens; Loan specimens to experts; Specimens are returned with identification or other information to make the collection ever more complete and useful. Repeat indefinitely. A natural history collection grows in size and value over time from this small set of activities.
Museums are a step higher than this, and house multiple natural history collections. The growing value of the collections is used for research by the curators, and the curator's research is used to educate the public. But they are first and foremost for housing collections, which is where the value and primary work within a museum starts.