in short : the function assert(bool condition) : throws if the condition is not met.thus in your code if the condition is false the inside function will throw and stop the contract execution.