Our local state primaries are excellent - laying good foundations in all sorts of ways, I think, not just academically.
Our local secondary school has been dire, and is on the way up.
So for us, it would seem a no-brainer: state for primary, private for secondary.
But as others have said, its more complex than that in reality. dd1 is so happy at her state primary, and is the sort of child who thrives on stability and continuity in her relationships - it would be so wrong to move her, so she's staying till Y6. Which means pretty much all of her friends will be going in to State secondary education - which means dd will be very reluctant to go somewhere where she knows no one.
Plus, the local private secondaries turn out to be the sort that 'manage out' dyslexics or other SENs, and don't fit our values. Plus, I'm not sure any of them would suit dd1 (dd2 yes).
Plus, schools change SO much over the years - the school that dd is at, which is wonderful, was the local sink school when dd was born. You could set your heart on somewhere that is great now, but isn't by the time your DC are old enough to apply!