It's a hematoma. It can be caused by injury, a bite, or a sting. A mare I had years back got one about that size in about that same location. We never did figure out why/how either. The vet came out and lanced it and drained, then showed us how to drain it and flush it daily. We drained it daily plus gave her a round of antibiotics. After a couple of weeks, it was cleared up and she was good as new! Not even a scar remained, from the lancing & draining.
I would definitely take her to the vet tomorrow.