Why did state socialism emerge?

Was the emergence of the state socialist system an historic accident? Can we see "those forty years" as a modernisation experiment, or it was only a path of maldevelopment forced upon us by great power agreements? One can often face these questions in public discussions, but now it is leading Hungarian historians who try to give an answer.