When photographic film and plates were used for astronomical imaging, it was common to produce a final image from a single exposure, which might last for hours. Digital sensors don't work as well for such long exposures, but make it easier to combine short exposures, which brings several benefits. I'll try to address both aspects below, though it is a large topic. I'll note that combining multiple exposures is a common technique in both astronomical research (for quantitative scientific analysis) and astrophotography (where an aesthetically pleasing rendering is the objective).
I'm going to focus only on multiple exposures of a single field (not "panorama"-type merging), and I'm going to focus on merging exposures to produce images that show faint detail and sharp stars, not star trails shots. (Star trails are also often photographed in multiple exposures, for the reasons I describe in my first section, but the benefits I describe in my second section don't really apply.)
Why don't digital sensors handle long exposures well?
Each pixel in an image produced by your camera corresponds to a photosite on the sensor. The photosite's job is to absorb photons (particles of light) and convert them to electrons. These electrons build up during the exposure in proportion to the number of photons hitting the photosite, and then they're read out (basically, counted) at the end of the exposure, to give the brightness of that pixel.
Each photosite has a maximum number of electrons that it can hold, called "full well." Once a photosite hits "full well", any additional photons that fall on that photosite will fail to be counted—the photosite or pixel is said to be "saturated". So one downside to a long exposure is that the brightest stars in the image may saturate early in the exposure and their full brightness compared to fainter objects may not be recorded. (They may also cause artifacts like spilling over into large, ugly "saturation trails" on some types of sensor.)
But another problem is that throughout the exposure, electrons are building up in all the photosites due to noise. One source of noise is "dark current", which arises from the temperature of the sensor. Sensors in research instruments at observatories are normally cryogenically cooled, for example with liquid nitrogen. This keeps dark current at a pretty negligible level in these instruments. Many amateur astronomical sensors are cooled with dry ice or a thermoelectric cooler, which isn't as cold, but still helpful. Ordinary DSLRs are not cooled at all, and in fact heat up during an exposure, so the dark current is significant. Besides dark current, the brightness of the sky, even at a dark site, causes electrons to build up in the photosites.
As these "background" counts from the sky and dark current are building up, the gap between the background and full well for the photosite narrows, reducing the "dynamic range" between the faintest and brightest objects you can record. Eventually, if your exposure were long enough, every photosite would be saturated from the background, and you wouldn't have any detail anywhere.
So, if long exposures are bad, what's the good news?
The good news is that with digital images, it's pretty easy to combine a bunch of short exposures into the equivalent of a long exposure, by adding or averaging a pixel's values in each exposure to produce the final image. But while we're doing that, we can take advantage of several benefits:
We can fix up tracking errors. As you know, the night sky appears to rotate overhead as the earth turns on its axis. This means that for a long exposure, your camera or telescope needs to follow this apparent motion, and it needs to do so very accurately, to keep the stars from appearing out-of-round on the image. For very brief exposures (~seconds) you might get away with a camera fixed on a tripod. For longer exposures (~minutes or possibly longer) you can use a clock drive that turns the camera at the same rate as the sky; this is called tracking. But the clock drive probably isn't exactly the right speed, and the polar alignment of the mount probably isn't quite right, so for longer exposures you need an autoguider (or a lot of patience to guide by hand). Guiding corrects for errors in tracking, by "watching" a star and keeping it in the same place during the exposure.
If you combine short exposures, your tracking or guiding only needs to be good enough to keep the stars sharp for the duration of your short exposures. Before combining the short exposures, you register the images to line everything up again. This can usually be done automatically with software.
We can throw out bad exposures. If an airplane, or a satellite, or a car's headlights, ruins a 30-second exposure, you can toss out that 30-second exposure and use the rest. This is way better than throwing out a 5-hour exposure because of the same defects.
We can avoid sensor defects and other bad pixels. As noted above, there's likely to be some tracking or guiding error that means we need to register the images before combining them. Because of these small errors, a particular star will probably fall on a different pixel in different exposures. So if our sensor has a bad pixel or bad column, we can average our exposures in a way that only uses the "good" values and not the "bad" values. (On telescopes that guide well, like observatory-class telescopes, the telescope may be deliberately offset slightly between exposures to achieve this benefit.) Also, cosmic rays often cause "hot pixel"-like effects in long exposures, so we can find those pixels and exclude them from the average.
Our exposure can be longer than a night! Thus far, astronomers' efforts to destroy the sun have been thwarted by the soulless minions of orthodoxy. As a result, each night is only something like 12 hours on average, and not all of that is completely dark, and whatever object we're trying to photograph may not be up the whole time, depending on the time of year and our location. So combining exposures lets us take exposures on multiple nights. This also means that we can plan our observing over multiple nights, to observe each object during the time of night that it's highest in the sky, so we're looking through less air than when it's near the horizon.