Necessary and insufficient conditions for well-posed Cauchy problems