✓ Accepted answer Fellow
Youssef, I keep the Muqaddimah next to Capital on my shelf, so this is my favourite question.
What he says: in the chapter on livelihood, Ibn Khaldun argues that profit and gain are, wholly or mostly, the value realised from human labour. Even where the source seems natural, like crops watered by rain or minerals, he insists labour is involved in making them available, and its contribution is just less visible. He distinguishes sustenance (rizq), what actually benefits you, from acquisition (kasb), what you gain through your own effort. He also connects labour to the prosperity of cities: where there is much labour and specialisation, there is wealth and luxury; where population and cooperation decline, crafts and gains decline too.
How close: very close to the core intuition of the classical labour theory, that labour is what creates value. Arguably closer to Smith, who also tied the division of labour to the wealth of societies, than to Marx.
Where it misleads: Marx's theory is about how value under capitalism is measured by socially necessary labour time and how surplus value is extracted. Nothing like that machinery is in Ibn Khaldun, and it couldn't be; he wasn't analysing wage labour under capitalism. So "he anticipated the intuition" is fair. "He invented Marx's theory" is not.