Who is Erza? You might be wondering... well here is a little info. She was born in Rosemary village but was eventually caught by an occult who worshiped Zeref. She was brought to the Tower of Heaven as a slave, forced to work on its construction. Here is where she met Miliana, Simon, Jellal and Rob, a former Fairy Tail Mage. They formed a plan to escape but it went awry, Erza losing one eye in the process. They planned a revolt again and Erza was able to escape, however she left behind her friends in the process. She sought out Fairy Tail based on Rob's stories and joined, quickly becoming friends with the other orphans there. She uses requip holder magic called The Knight and quickly became an S-Class mage.
Their guilds had fought a war against one another so when Juvia showed up with Team Natsu at the Tower of Heaven, Juvia was sure her head would be handed to her. Much like when she first approached Gray, she is visibly shaking when she sees the red haired mage. Juvia wanted to enter Fairy Tail and while Gray had given her his blessing, she did not think Erza would say the same. She was an important person and held a lot of weight in the guild. People would listen to her. Erza however doesn't even question her presence, eventually welcoming both her's and Team Natsu's help in defeating Jellal. With Jellal defeated, Juvia went running to Fairy Tail ahead of Team Natsu to ask to join. Erza was actually upset, because she wanted to put in a good word for her but now couldn't. From here on one could say they strike up a rather fun and odd friendship.
While one would argue that Erza has a better friendship with Gray than Juvia, I find it still works out for everyone in the end. Like everyone in the guild, Juvia looks up to Erza with great respect and admiration. She is also one of the few females that Juvia does not consider a "love rival", although she had shown some minor jealousy. As for Erza, I think she is one of the few people to really know and recognize Juvia's potential as a mage. Erza is also concerned with how Juvia feels about her, worried that the water mage might take their S-Class exam battle personally.
If anything, Erza is that amazing middle man between Gray and Juvia. While she never officially says it, you can tell she is rooting for Juvia and wishes her & Gray the best. She will on occasion console Juvia when things don't go right, however its mostly Gray she talks to. Which is a good thing, cause no one else really talks to Gray about Juvia, except Lyon in later chapters. Erza tries to nudge him in the right direction or will tell him "Hey....you know how Juvia feels about you". Juvia probably doesn't know that Erza does this, but i'm sure if she did she would be very happy.