Some dogs are born with hip dysplasia, it's a tendency some dogs just have, and it varies in severity. My cousin-in-law took over care for a Newfie who initially had it so bad he had to be lifted into the car - thankfully Ted is a former football player, so strong enough. But with exercise and diet - poor thing was badly overweight - I was thrilled to, just a year later, see him spring into the truck on his own, so weight can definitely play a big role in this.

Larger breeds are more prone to it than Border Collies, but it can happen to any dog ...

It could also be a strained muscle or a pulled one, let us know what the vets says!