Megatron and Optimus Prime
Skids
Mudflap
Second Bumblebee statuette
Stars are formed when a cloud of gas collapses under the force of gravity. When the core of a star is compact enough, the gas atoms will fuse to release tremendous amount of energy in a process called nuclear fusion. The life of a star depends on the fine balance between the outward pressure produced by the fusion and the inward pressure exerted by gravity.
In simple term, a star continues to burn as long as there is sufficient amount of gas at the core. The heavier a star is, the faster the fusion is and its lifetime will be shorter. When the star exhausts its fuel, it will either explode in a supernova explosion to become a black hole, a neutron star, or collapse into a white dwarf.