Observing my very sweet 4yo grandson, and many other kids over many years, it seems very likely to me that children come "pre-programmed" with the capacity for certain kinds of responses. Whining, pouting, and explosions of temper are some examples. Also snuggling and giggling. These come quite naturally to all children. Snide, snarky tones of voice are very possibly pre-programmed, too, just waiting for the right set of circumstances to come bubbling forth.
That said, external influences will probably exaggerate any such behavior. Adults are a significant influence, and over time, a child raised in a respectful, well-mannered home will mirror what she sees/hears. And of course a child is more likely to tantrum if she sees other children melting down, especially if there is some reward for their behavior. (Even "punishment" can a reward if it wins some attention the child wasn't getting previously.)
From your description, K., it appears that your reactions to your daughter's behavior are probably a big part of the problem. If she intuits that she has hooked you emotionally, it gives her a sense of power. Now, I don't think children deliberately this young deliberately plan ways to gain power, but when that is the result of any behavior they engage in, of course they'll do it more. Power is very heady to a small child who's pretty much always told what to do and when to do it, with little choice of her own.
So here's what I'd do. Stand in her shoes. Frequently. Look at life from her perspective, and notice all the situations that are truly frustrating, even maddening, for a small person with very little autonomy. Then set about reducing as many of those frustrations as you can.
Be deliberate and open about this, explaining to your daughter that you can see that she needs a little more say in her life. I can almost guarantee that she'll be surprised and grateful. I've seen parents try this and get instant, positive changes in their kids' behavior.
The other thing I'd do is also based in understanding your daughter's frustration, but for your own benefit. If you know she's not really attacking YOU, mommy, but reacting childishly out of her frustration, you can probably realize you don't have to take it personally (might take a little practice). Then her behavior will be just that: what little kids do until they know better.
If you can stop reacting to her tone of voice, even subtly, she'll gradually stop using it. She'll move on to some other experimental behavior instead :-). That's parenting!