It's only ended when both sides have insufficient material for mating. For example king + one bishop vs king. Or king and knight vs king. If one side has enough pieces to legally mate the other, the game continues. Simple as that.
Or if you are down to a king and the other side has enough pieces but runs out of time, the game is considered drawn because the "winner" was not capable of mating.
Why is it that sometimes i am down to the king and have to make moves until checkmated? Whereas someone elses last peice is taken and game is over due to insufficient material? Is the universe against me?