This ayah is addressing the Israelites who were arguing with Prophet Musa about a cow they were ordered to sacrifice. Their reluctance and questions about the sacrifice showed their arrogance and disobedience towards Musa and towards Allah swt.
Their hearts were harder than stone.
Then your hearts hardened after that, so that they were like rocks,
rather worse in hardness: []The next sentences show why their hearts
were worse than rocks in hardness: “and surely there are some rocks
from which streams burst forth”. The sentence offers a contrast
between rocks and water. Rocks are used as examples of hardness, while
water is proverbially used to denote softness. Even then, there are
some rocks - with all their hardness - from which streams of water -
with all its softness - burst forth; “and surely there are some of
them which split asunder so water issues out of them ”: The hard rocks
send forth the soft waters; but the Israelites' hearts were so hard as
never to allow any truth to issue out of them.
Of course this ayah is telling us to keep our hearts soft and struggle against arrogance in ourselves, so that we can follow the truth when it is presented to us. It shows that the obedience towards a Prophet is key as it is obedience towards Allah swt.