Some of the first photographs ever taken in 1838 were of the Moon, so we could say that astrophotography pre-dates portrait photography. Further, the invention of the digital camera's CCD chip was first used in astrro-photographic applications.
For years astronomers took pictures of deep sky objects by taking a series of very long exposures from about 30 min up to several hours. These photgrphic sessions were tedious and the long exposure times opened up vulnerabilities to the process. Imagine if 75 minutes into your capture a plane or sattelitepassing through the field, or a gust of wind shaking the scope.
With the advent of CCD immaging, the time reguired to image a deep sky object was reduced to less than two minutes. The problem is that the equipment is very expensive. A greyscale CCD camera for astrophotography can cost from $3,000 to $10,000.
Enter the WebCam and some immaging software and the pricetag is reduced to less than $100!