Lots of things will impact the two camps - camp of mine were fine, vs. mine are a nightmare:
Eating out often
Kids being into food
Discipline / boundaries / parenting style (talking about the expectations before the meal)
LOTS of praise when they are doing it right (key one)
Eating at the table at home (so many children I know, ok anecdotal, have dinner without their parents at home, so when they go out, they aren’t used to eating with other, picking up on the social cues that we as adults know)
Both parents there (tag team)
Activities / distractions
No. of children
Length of time it takes food to come
SEN/ hyperness
LOTS of things that all feed into if a child behaves or not. I could say mine were perfect but it means nothing really; I might have been lucky OR I did a combination of the things above that made it easier for us to instill good table manners (we’ve always eaten at the table at home, one DC so far easier, eaten out a lot, I’m strict on not getting up from table from very early age, at home and out and about, my child loved her food so that was/still is a bonus)
@WildWombat don’t sweat it too much. Keep doing what you’re doing. Try talking to the 4yo about what it means to go out for a treat lunch/cake and it only happens if she behaves in a certain way and remember, keep talking about how amazing she is during and afterwards (when she has behaved) even to other people, children love to hear how proud mummy is.