JKR actually spoke about this in 2014 with Emma Watson because many readers questioned that pairing (including myself) and I recall debating this with a classmate who was angry that JKR said that Rob and Hermoine was a mistake. Then JKR kind of backtracked years later after that saying it was an opposite attracts kind of relationship while calling Harry and Ginny soulmates. Harry being with someone that looks like his mum, ok. She didn’t call Hermoine and Ron soulmates which they weren’t. I think JKR should have went with her first thought and killed off Ron and kept Fred.
Saying that I found their pairing disappointing. It reminds me of when I hear people, especially women tell little girls that when a boy bullies them or hits them it means said boy likes them. It makes me cringe because it’s conditioning females from a young age to equate male violence with like/love. As someone who was also bullied by boys for years, it definitely hits a nerve.
I think JKR was wrapping things up in an easy bow which kind of makes sense. I think Hermoine would have likely ended up with Ron (unfortunately) because it was easy and after losing her parents, being tortured, dealing with everything she had since entering the magic world, I think she would have taken the easy choice.