Al-Luma fi Asbab al-Hadith is a compendium of well known ahadith which gives reasons of their revelation by the Beloved Messenger of Allah, may Allah bless him and grant him peace. It specifies the occasions & reasons when the Beloved Prophet, may Allah bless him and grant him peace, said or did things that are codified in the collection books of hadith. From this information we can then fully understand the context of the hadith.

Born to a Turkish mother and non-Arab father and
raised as an orphan in Cairo, he memorized the Qur'an at eight, then
several complete works of Sacred Law, fundamentals of jurisprudence, and
Arabic grammar; after which he devoted himself to studying the Sacred
Sciences under about a hundred and fifty shaykhs. A giant among
contemporaries, he remained alone, producing a sustained output of
scholarly writings until his death at the age of sixty-two. He was
buried in Hawsh Qawsun in Cairo.