Let me give some guidance here on how I think about it.
- It's critical to have a strong vision, strategy, roadmap, and success metrics for a team
- Your org structure should be organized to support the pillars of your strategy
- Beyond this there optionality to organize your team functionally the way that engineering teams are organized or strategically that maps more to your success metrics or some hybrid of both
- Most critically though you need to have as clean as possible swimlanes for PMs. Giving them a problem area to solve gives them a runway to grow and build a visions, strategy, roadmap, and success metrics for themselves. Don't give them projects, give them problems.
To directly answer your question though I organize my team strategically tackling the strategy pillars we've set out to solve and my engineering and ux counterparts map our squads to each other based on the most logical function overlaps. But this does mean that one PM may be interacting with several engineering leaders to get their work done.