The miraculous feeding with only five loaves and two fish had taken place late in the day, after which Jesus sent the disciples ahead in their boat while he stayed in a mountain, to pray.
The disciples should have heeded why Jesus told them to feed the thousands. It seemed an impossible situation, so they suggested Jesus dismissing the crowds to go to villages to buy bread. Yet Jesus told them to feed the crowd! They seemed to only have 200 pennies between them, which would have been nowhere near enough money to buy food to eat. So, Jesus asked them to see what food they had. It amounted to five loaves and two fish. He then proceeded to bless the tiny amount of food, start breaking it into baskets, and there was enough to feed the thousands.
Next scene was the disciples battling with oars on their boat against a strong wind. It was dark - the 4th watch of the night. Jesus saw them from the shore then walked over the water to them. That terrified them, but he assured them he wasn't a spirit, climbed into the boat, and the wind calmed. That is where the text tells us their amazement and wonderment was due to them not having considered the miracle of the loaves, just a few hours earlier - "for their heart was hardened".
Yes. They had not let the wonderful truths of that miracle sink into their hearts. They had observed it, and seemed to think that that was what Jesus did - provide miraculous food supplies from almost nothing. Likewise with the wonderful truth of the miracle in their boat previously, when a vicious storm had blown up while Jesus slept, and he stilled it with a word. Yet this time, they were also frightened and lacking understanding at the second storm. By now, they should have been wise! But they had not pondered who it was who was doing such miracles in their presence. No wonder Jesus asked them, "Why are ye so fearful? How is it that ye have no faith?" (Mark 4:35-41)
Hard hearts equate with no faith. But faith in Jesus as both Son of Man and Son of God finds its natural home in softened, open hearts. Hard hearts have to be prepared to receive the truth about Christ, to become open to just who he really is. John the Baptist's ministry had done that work of preparing Jesus' people to receive him, but John had just been beheaded prior to the miracles at the start of this question and answer.
By then, the disciples should have been prepared, and the good seed of the kingdom should have been taking strong root in their hearts. Yet at that point, they had not got beyond the stage of being taken up with what their eyes saw. They should have pondered what Jesus said to them - "You feed them". Then, "What do you have?" Then he took what little they had and performed a miracle. They should have learned from the loaves that the one who could do miracles with mere bits of bread could still the wild wind with a word, and calm the tossing seas likewise. This was no mere man, though he was fully man! And he was training them to follow in his footsteps, so they should have been out to learn the significance of miracles in how they showed this Jesus to be the foretold Messiah, the Saviour.
In all the miracles, this one with the loaves included, the lesson to be learned was about spiritual food, but for as long as they couldn't even cope with literal food and literal wild waves and wind, their hearts were not yet softened enough to be open to just who this Jesus truly was. Not that we would have been any different if we had been in their sandals back then. We are just as slow to learn, because our hearts need to be softened with more faith.