When a complaint is dismissed without prejudice, the complaint can be refiled.
When a complaint is dismissed with leave to amend, the complaint can be refiled.
The case can continue.
When a complaint is dismissed without leave to amend, the complaint cannot be refiled.
When a complaint is dismissed with prejudice, the complaint cannot be refiled.
The case ends.
But there are variations on this theme which can complicate matters. And the distinctions can be important when it comes to a party's ability to appeal.