I suppose it all ultimately comes from solar energy, which, in turn, comes from nuclear fusion.
GRAVITY!!!
The ingredients needed for fusion on the other hand are thought to have been created during the some of the early stages of the Big bang so fusion is truly independent of stars.