The child is trying to send a message to the caregivers and it is up to them to figure out what the message is. When I taught a parenting program, I would use the following scenario to demonstrate. You take your child to the park and play for a time, partly child plays alone and partly you join child and also have some fun, you help them on the teeter-totter, help them up the slide, push them on the swing, and have fun together. You realize it's late afternoon and need to go prepare dinner. Child does not want to leave and throws a tantrum. You can let the tantrum make you mad and you then yell at the child to stop crying or s/he will spend time alone in their room when you get home. Problems? Your child has control of you because they know how to push your buttons, and then you send them to spend time alone in their room which then stresses the attachment. Instead, read the message. The child is having a great time and they just don't want it to end. You squat down to their level and show empathy with the goal of co-regulation: "You really don't want to go! Neither do I because we are having so much fun together. Pretty soon we are going to get hungry, so we have to go make dinner, but we can come back and have more fun again tomorrow." The child just needs co-regulation, empathy, and attachment security. They may still not be happy about it, but this method will teach children to self-regulate, think things through, plan ahead, feel safe with you.
The trick is to be attuned to your children, be able to read them and the situation so you can respond to their need, the need they may have trouble directly expressing.
So, when I see a child tantruming in public, I watch how the parent responds, but it does not bother me so much as when the parent is totally missing the message. The other day I went for breakfast out, and there was a dad with three young children. Two of them were tantruming and he was clearly not responding well. He almost became threatening, and I felt very sorry for the children, whose tantrums just got worse and worse. Then the food came and they quieted down and ate. Their tantrum message? "I'm hungry, the restaurant smells yummy, and I can't wait for breakfast!" But instead of engaging his kids, empathizing with them, understanding their hunger, he asserted his power over them and worked overtime trying to get their behaviour in line with his expectations. My heart broke for the children.