Definitely this. I'm in a large org at a large company and there are drastic differences between groups because of managers. Simply changing groups can completely change your experience from a toxic team to a great one or vice versa.
If a smaller company has a toxic culture or you have a toxic manager you may have no choice but to leave.
Just to add to this, a good manager can insulate a team from problems "outside" that team, but there's a balance. Too much insulation and you'll disappear from everyone else's view (no more funding for you!), not enough and you'll become a dumping ground for people/problems/projects.
If a smaller company has a toxic culture or you have a toxic manager you may have no choice but to leave.
Bad managers are everywhere!