This story shows the glory of Jesus (his divine power and greatness) to the disciples (6:48–50). It is also a rescue story, because Jesus comes to help them in danger (6:47–48, 51).
At the same time, it shows that the disciples did not understand what was happening (6:51–52).