A bit of everything really velvetee. Probably not a good choice of venue in the first place for a 5 year old. You don't have to limit yourself to McDonalds and Pizza Hut, but a nice family restaurant probably would have been a better choice. Everyone was probably a bit on edge and a child will pick up on that and play up sometimes. The parents should have brought a suitable distraction (e.g colouring book etc). And she should be more disciplined, but sometimes listening to parents shouting at their kids in a restaurant is more of a distraction than the child themselves.
Also, with the best will in the world, sometimes kids just have an off day and may behave nicely 9 times out of 10 when out for a meal, but it is that 1 bad time that gets remembered.
I would say from your point of view, some of it is down to your childs personality and you cut your cloth accordingly - some people will have quiet natured children that are happy to sit and take in the world around them and others never sit still or shut up (in my experience, this is usually child number 2, 1st children do tend to have quieter dispositions - I guess it is natures way of ensuring that there are 2nd children. The number of people I hear that say that if they had had their 2nd child first, they would have stopped at 1!). Some of it is down to your general discipling and boundary setting and the rest is about planning and choosing places to go that fit in with what your child is capable of.
We have always taken our kids out to eat and to hotels, and I think that on the whole their behaviour is good, it is a very familiar activity to them. I think that you just try your child out with different places and you find what suits you.