The factors behind the morphotropic phase boundary in piezoelectric perovskites