There are several problems that stop us from just pointing a camera at the sky and snapping pics of distant galaxies, which need to be overcome to produce deep space photos:
Take all of this together and it's possible to take pictures of extremely distant and dim objects.