This meant that they were caused by a star 's outer layers being thrown into space at the end of its life . This led to the idea that planetary nebulae were caused by a star 's outer layers being thrown into space at the end of its life .