0 is similar to true usually in coding, so if you write/run return 0, it reads as return true, which is basically the same as "exit with success" in human terms. It could also be seen as "return with 0 errors/flags."
But if there is a mistake in your code, then the compiler/interpreter automatically returns 1, with your error before or after it (usually).
:)