I don't think Merman hated Sondheim, it's just that he was young and unproven and she was a Broadway legend.
If anyone ever tells you that you put too much Parmesan cheese on your pasta, stop talking to them. You don't need that kind of negativity in your life.
I think the story is Jerry Robbins and Stephen Sondheim kind of improvised the whole thing over a few hours together in the rehearsal space, although he used existing melodies from other numbers from the score that had been written by Jule Styne, so Sondheim didn't want to take credit for composing it (although I suppose he arranged it). As for the Merm hating Sondheim, I wasn't aware that she did.
"Contentment, it seems, simply happens. It appears accompanied by no bravos and no tears."
From what I've read, Sondheim thought Merman wasn't too bright and he was hurt by Merman's insistence on hiring a proven composer thanks to Happy Hunting being only her second flop ever (though I think Happy Hunting's score is super fun).
It definitely was an Arthur joke. But in a way, Merman was "The Talking Dog." Everything about that performance was very, very calculated by her and Jerome Robbins. And she had a habit of walking through the show as the run went on, as far as I've heard.
Different people say different things about her performance. I have no doubt that Ethel's performance decreased in quality over the two years that she played the role, but wouldn't anybody be tired out from that show? It also might be possible that her performance was calculated, but most people who saw her thought she was incredible. Some people claim it was the greatest performance they have ever seen. I've heard Ethel, Angela, Patti, Bernadette, Tyne, and Bette, and for my money nobody sings the role with more emotion than Ethel. That's a rather uncommon thing to say, but for example her Rose's turn on recording is just so much more heartbreaking.
Oh, there's no denying it was extraordinary, just because she was Ethel Freakin' Merman, and the role was tailor made for her. I just want to make it clear that I wasn't saying she stunk or was boring. Merman couldn't be boring.
She didn't hate Sondheim. She didn't want to work with him on Gypsy at first because she felt that he didn't have enough experience. She was concerned about this due to the fact that her previous show was a flop and she blamed the composers for their lack of experience.
I believe Sondheim said this in Six by Sondheim, but i may be wrong.
Ethel: "Does this Ma...Ma...Ma...Mama, come before or after the beat?" Stephen: "Rose is having a breakdown at this point so she is trying to get the word out, but it's not coming easy." Ethel: "Oh, OK. But does it come before or after the beat?"