Tafsir Ibn Kathir -> Surah Al-Kahf -> The Story of repairing the Wall Allah tells us that

﴿فَانطَلَقَا﴾

(they both proceeded) after the first two instances,

﴿حَتَّى إِذَآ أَتَيَآ أَهْلَ قَرْيَةٍ﴾

(till when they came to the people of a town,) Ibn Jarir narrated from Ibn Sirin that this was Al-Aylah. According to the Hadith;

«حَتَّى إِذَا أَتَيَا أَهْلَ قَرْيَةٍ لِئَامًا»

(When they came there, the people of the town were mean.) i.e., miserly

﴿اسْتَطْعَمَآ أَهْلَهَا فَأَبَوْاْ أَن يُضَيِّفُوهُمَا فَوَجَدَا فِيهَا جِدَاراً يُرِيدُ أَن يَنقَضَّ﴾

(they asked them for food, but they refused to entertain them. Then they found therein a wall about to collapse and he (Khidr) set it up straight.) means, he fixed it so it was standing upright properly. We have already seen in the Hadith quoted above that he set it up with his own hands, supporting it until it was standing straight again, which is something extraordinary. At this point Musa said to him:

﴿لَوْ شِئْتَ لاَتَّخَذْتَ عَلَيْهِ أَجْراً﴾

(If you had wished, surely you could have taken wages for it!) meaning, because they did not entertain us as guests, you should not have worked for them for free.

﴿قَالَ هَـذَا فِرَاقُ بَيْنِى وَبَيْنِكَ﴾

(He said: "This is the parting between you and I) meaning, because you said after the boy was killed that if you asked me anything after that, you would not accompany me any further. So this is the parting of the ways between me and you.

﴿سَأُنَبِّئُكَ بِتَأْوِيلِ﴾

(I will tell you the interpretation) meaning explanation,

﴿مَا لَمْ تَسْطِـع عَّلَيْهِ صَبْراً﴾

(of (those) things over which you were not able to be patient.)

﴿أَمَّا السَّفِينَةُ فَكَانَتْ لِمَسَـكِينَ يَعْمَلُونَ فِى الْبَحْرِ فَأَرَدتُّ أَنْ أَعِيبَهَا وَكَانَ وَرَآءَهُم مَّلِكٌ يَأْخُذُ كُلَّ سَفِينَةٍ غَصْباً ﴾

(79. "As for the boat, it belonged to poor people working in the sea. So I wished to make a defective damage in it, as there was a king behind them who seized every boat by force.'')