Stars are light. A camera uses light to create images. The longer the shutter is open, the more light hits the camera's sensor. We adjust our shutter speeds on a regular basis - you notice the effects of this more casually. An over exposed photo or a blurry photo of someone indoors.
In addition to more light getting in, the shutter being open longer also captures more movement (all movement) - everything that happens while the shutter is open is captured by the camera's sensor. When used incorrectly, your shaky hand or your shaky subject will result in a blurred image. However, when your camera is on a tripod, the shutter can stay open as long as necessary. And when your camera isn't moving, it can create some amazing photos.