Can science cover the real purpose of a thing/event?
And there lies the narrow-mindness of one who think everything have purpose.
In order for there be purpose, the entity must be consciousness of its own existence, and make choices on direction of decision or the path to be taken.
So obviously man can do thing with or for specific purpose. He can choose one religion or another, and believe what he believe in...or none at all. He can decide on the education he receive, depending on what career or job to do.
But is a rock "conscious"? Can a rock decide to be anything other than a rock?
A rock can't decide its own purpose, but man can make use of rocks, thereby deciding its purpose, but only for man's own use.
The sun, or any star, is not conscious, can't consciously decide to do this or that. It create energy through thermonuclear fusion of its fuel - hydrogen - by fusing two hydrogen into helium atom. This result in tremendous amount of energy, which give light and heat. It does so without conscious guidance or intelligence. A star doesn't care what it does, because it has no ability to like or dislike what it does.
Eventually, the sun will run out of hydrogen fused, so it will begin to fuse helium atoms into heavier elements. Because of this change of event, the sun will become a red giant star, until it strip away all the outer layers of heavy elements and expelling them to out in space, until only the core of the sun is all that left. This core will all that be left of the sun, which mean the red giant will become a white dwarf star.
Scientists are able to predict the future (end) of our sun, by knowing the current mass of our sun, and they understand that it will not go supernova or turn into a black hole, because the sun is not massive enough.
Astronomers know this, because they study stars throughout space, and were able to predict how each star will come to an end, depending on their masses.
The stars don't consciously decide it will become "red giant", "white dwarf", "neutron star", "blackhole" or exploding as a "supernova".
And this sort of knowledge don't come from religions or their scriptures, and there is absolutely no evidences that any god or intelligent designer being involved with any event of the star.
The Qur'an for instance, give a metaphor that the stars are little lamps (don't remember the verses in the Qur'an), not knowing that these stars are like the sun. The Qur'an make the distinction that the sun and stars different, because the author don't realise the sun is itself an actual star. The Qur'an also stupidly make mistake that the stars only appear at night, but there are stars everywhere, and it doesn't matter if there is daylight or night at Arabia.
In matter of science, religions, especially in their scriptures and traditions, are poor sources of knowledge of the physical, natural world, because they are often give superficial observation, which is why the Qur'an never explain natural phenomena, but provide vague description.
As an agnostic, this is only my standpoint on the matter of theism, and nothing else. My education, career and social life is not dependent on my agnosticism. My source of knowledge come from everything that I have managed to learn through schools (and universities), through jobs, through social interaction with other people, and anything else that I might have left out.
My agnosticism is the least important of all other knowledge, and certainly the least practical.