When stars which have a Main Sequence lifetime which is less than the age of the Universe get old and die, they swell up to become red giants, or supergiants. In the process, their surface gravities become much lower, and the convective motions in their outer layers help drive a mass loss which can reduce their masses by a substantial amount during the last stages of their life.
If the giant star is a single star, as the Sun is, all that happens as a result of the mass loss is that it becomes less massive, and ends its red giant lifetime, and its life as a whole, a little sooner. But if it is a member of a binary star system, as a large number of stars are, then there can be a transfer of mass from the dying star to the other star, resulting in a number of interesting possibilities.
When the other star is a Main Sequence star, the transfer of mass increases the weight compressing the core of the star, and as the core becomes denser and hotter, the nuclear reactions go faster and faster, producing an ever larger amount of heat, and making the star swell up to a larger, hotter, brighter structure which corresponds to the now larger mass which it has. In other words, it remains a Main Sequence star, but moves up the Main Sequence to a position corresponding to its new mass. This sort of thing must have happened to the star Sirius, which is the brightest star in our sky, other than the Sun, partly because it is one of the closest stars to our Sun, and partly because it is a little over twice the weight, and twenty times the brightness of the Sun. Such stars only last about two billion years as Main Sequence stars, but Sirius has a companion, Sirius B, which is a white dwarf about the same mass as the Sun. Since a star like the Sun can last for over ten billion years as a Main Sequence star, it is impossible for the less massive star to have already died, while the more massive star still lives. At one time, the star which is now less massive must have been the more massive one, and as it grew old, it swelled up, dumped material on its companion, and in the process, became a less massive star, while its companion became a more massive one.
But suppose that the companion is not a Main Sequence star, but a white dwarf, the most common type of dead stellar object which we know of. In this case, as the dying star transfers material to the white dwarf, the nuclear reactions in its core will not go faster, because white dwarfs cannot have any nuclear reactions inside them. In a normal star, if nuclear reactions go a little too fast, the gas will heat up, increase its pressure, and expand, which will reduce the temperature, and damp down the nuclear reactions, forcing them back toward a value closer to the average heat loss of the core. If the nuclear reactions go too slowly, the gas will cool off, decrease its pressure, and contract, which will increase the temperature, and increase the nuclear reactions. In either case, the relationship between temperature and pressure which applies to normal gases will guarantee that the nuclear reactions cannot go too fast, or too slow, at least on the average. In the electron-degenerate material which makes up a white dwarf, however, pressure and temperature are not linked. If nuclear reactions go too fast, the temperature will rise, but the pressure will not be significantly changed, and the increase in temperature will simply make the nuclear reactions go faster and faster, until, as in a chain reaction, the region which contains nuclear fuel simply undergoes a catastrophic explosion. (Note: This is discussed in the text under such topics as the Helium Flash which occurs during the red giant lifetime of the Sun.) Because of this, it is not possible for a white dwarf to have any nuclear burning going on inside it. So, when new material is dumped onto the surface of the star by a companion, the mass of the star increases, and the pressure inside the star increases, but otherwise, nothing much happens, at least for a while. Over a long period of time, however, as more and more material is dumped onto the star, the pressures and temperatures within the electron-degenerate gas do begin to rise, and if they reach values where nuclear burning can begin, there will be an explosion of considerable violence.
How violent the explosion is depends upon the size and mass of the white dwarf. Since white dwarfs, unlike Main Sequence stars, are smaller the more massive they are, a white dwarf with a mass near, but not too near, the limit of mass for white dwarfs (the Chandrasekhar Limit) will be relatively small, and have a relatively large gravity. This means that material falling onto the star will very quickly reach high pressures and temperatures, and so little material will accumulate before an explosion occurs, and the explosion will be 'relatively' minor. This is believed to be the reason for so-called recurrent novae, such as RS Ophiuchi (shown below). Over a period of a few dozens to a few hundreds of years, material piles up on a massive white dwarf, then explodes, making the object millions of times brighter for a short while. After the explosion is over, more material has to accumulate before another explosion can take place, and so there will be another few decades or centuries before the nova recurs. (For white dwarfs with masses extremely close to the Chandrasekhar Limit, see the note following neutron stars, below.)
Artist's conception of the recurrent nova RS Ophiuchi. The red giant on the right is continually dumping material onto the white dwarf on the left. Every twenty years or so, temperatures in the white dwarf's not-quite-degenerate envelope reach fusion values, and a runaway reaction causes a nova. Even though the system is two thousand light years from Earth, the novae can be seen with the unaided eye, in a dark sky. Over time, more and more mass will be shed by the red giant, and eventually -- perhaps a hundred thousand years or so from now -- the white dwarf may reach the Chandrasekhar Limit, and have a far more violent explosion -- a supernova that will blow it to bits. (David A. Hardy & PPARC, apod060726)
If the white dwarf has a relatively low mass, it will have a relatively large size. Such an object would have, for a white dwarf, a relatively low gravity, and it might require a very large amount of material to be added to it before it would finally be capable of nuclear burning. Since, when nuclear burning finally starts, there would be a huge amount of nuclear fuel burnt in a very short period of time, there would be a tremendous explosion, which in some cases, might completely blow the white dwarf to bits. Such an event is called a Supernova, and although not all, or even a very large fraction of supernovae are believed to be caused by this particular mechanism, there is almost no doubt that at least some such explosions do occur.
What if the companion of the red giant is a Neutron Star? Since such objects are incredibly small, and have incredibly large gravities, when material falls onto their surfaces, it doesn't have to pile up at all in order to reach nuclear burning temperatures. Instead, material instantly flashes into nuclear fusion, resulting in a small, but extremely energetic explosion. As more and more material falls onto the neutron star, there will be more and more explosions, resulting in a frequent release of high energy radiation. It is believed that X-ray bursters are caused by this sort of event.
For white dwarfs extremely close to the Chandrasekhar Limit of mass, the theoretical size would be much smaller than a normal white dwarf, and accretion would result in phenomena similar to those for neutron stars. However, such stars are probably rare, requiring the long-term accumulation of mass from a companion (e.g., the long-term forecast for RS Ophiuchi, above), because the Chandrasekhar Limit calculations presume that as a star contracts to smaller sizes, nothing happens to prevent further contraction except the onset of electron degeneracy. In the real world, various kinds of nuclear reactions can occur, which result in instabilities that blow off small amounts of mass, creating a less massive white dwarf, or produce a catastrophic end to the star's life, as the white dwarf nears the Chandrasekhar Limit, collapses to the size of a neutron star, and in the process, suffers a supernova explosion, resulting in the formation of a neutron star, out of what was originally a white dwarf!
If the amount of material falling onto the companion is very large, not all of it can fall onto the star at once. In that case, a rotating, swirling disk of gas called an accretion disk forms around the star. As material in the accretion disk falls toward the star, it is compressed to higher and higher temperatures and densities, and will become very bright, and filled with extremely energetic photons and gas particles. This is especially true for collapsars, extremely small objects, such as neutron stars and black holes, where the 'star' that the material is trying to fall onto is much smaller than the clouds of gas trying to fall onto it. In some cases, as much as a hundred times more energy may be produced in compressing the gas in the accretion disk, as would be produced by nuclear fusion. Thus, even one percent of a solar mass falling onto such a disk each year might produce as much energy as the Sun produces in its entire lifetime. (It is thought that quasars are related to such processes occurring near supermassive black holes in the cores of primitive galaxies.)
Because there is a large amount of material in the disk, it is difficult for the light and energetic particles produced by the compression of the disk material to escape in that direction. Instead, they emerge from the poles of the disk, particularly in those regions closest to the collapsar, where the temperatures are highest. In some cases, particles can be ejected from the poles at near-light-speed velocities. SS433 is an example of energetic particle ejection from the poles of an accretion disk, and such phenomena are often the only evidence we have of the existence of a neutron star or black hole. Since such accretion disks can only occur in stars which are accumulating mass from companions, single stars which turn into black holes or neutron stars are almost never detectable in this way.
Finally, there is the question of the long-term fate of binary companions which are subjected to mass transfers. If the explosions which occur as a result of mass transfer result in a net loss, or at least, no net gain, of matter, then the explosions will continue until the other star ends its red giant lifetime, and there is no more mass transfer. But if the rate of mass transfer is very large, as in the case of an accretion disk transfer, then the star receiving the mass transfer will gradually grow in mass. For a Main Sequence companion, this would simply push it further and further up the Main Sequence. For a white dwarf, it would make the star smaller and smaller (since more massive white dwarfs are smaller than less massive ones), and if it eventually reached the Chandrasekhar Limit, it would collapse to a neutron star, with catastrophic results. If it were a neutron star, it would eventually collapse to a black hole, producing a gamma-ray burst. If it were a black hole, it would simply gobble up the mass, and become more massive.