Time Management
why does the rule say if you run out of time you lose
Because that's the rule. That may sound facetious, but that's all there is to it. You might have been ahead in material, but you were able to do so in more time than your opponent, and, more importantly, in more time than the rules allowed. Therefore, you were really *not* ahead, nor were you winning.
Thanks for any advice.