Shaykh Abdul Azeez ibn Baaz rahimahullaah in his Majmoo` Fataawaa vol. 13 pg. 255 was asked the following question:
Q: I have a cousin who slaughters on behalf of his father and grandfather after every year passes, and I have advised him more than once, but he says to me: “I have asked, and they said there is no sin upon me.” Benefit us, is this speech correct or not?
A: If he were to slaughter and his intent was the animal that was slaughtered on the day of Eid and the days of slaughtering on behalf of his father or his grandfather or other than them then there is no problem with that.
Or if he were to slaughter and then intend charity on their behalf for the poor people at any time then there is no problem with this; because the charity is benefits the ones that are alive and the deceased, whether the charity be in the form of meat or other than meat – from money, food and other than that.
All of that is beneficial to the deceased person and the person that is alive, and it has been authentically established from the Prophet sallAllaahu alaihi wa sallam when he was asked regarding the man who gave charity on behalf of his mother after her passing, does she attain reward? So he said: “Yes.” (Agreed upon; Bukhaaree and Muslim)
And Muslim rahimahullaah also reports from the Prophet sallAllaahu `alaihi wa sallam that he said: “When the son of Aadam passes away all of his actions are cut off, except for three: A continuous charity, or knowledge which people derive benefit from or a righteous child who makes supplication for him.”
In conclusion: Giving in charity on behalf of the deceased person is beneficial to him according to the consensus of the Muslims, and likewise making supplication for him.
So if he intended by way of this slaughter-animal charity on behalf of his father or his grandfather or other than them, or if he slaughtered it on their behalf during the days of slaughter, seeking nearness to Allaah the Most High – however not that he specifies a particular day or a particular month to carry put the slaughter (apart from the days of slaughter ‘ayyaamun-Nahr) – or except if he were to seek out the times of excellence, such as Ramadaan and the nine days of the month of Dhul-Hijjah – then there is no problem with that and he receives reward as well as the deceased receiving reward in accordance to his sincerity to Allaah and his good, lawful provision.
However if he were to seek nearness to the deceased just as the ones who slaughter to the inhabitants of the graves seek nearness, or if he slaughtered for the sun, or the moon, or the Jinn – then this is major Shirk (Polytheism); as it is not permissible for anybody to seek nearness to anyone by slaughtering or making a vow or other than that from the forms of worship – except to Allaah the Most High, due to His saying – He, The Most High:
قُلْ إِنَّ صَلَاتِي وَنُسُكِي وَمَحْيَايَ وَمَمَاتِي لِلَّهِ رَبِّ الْعَالَمِينَ لَا شَرِيكَ لَهُ ۖ وَبِذَٰلِكَ أُمِرْتُ وَأَنَا أَوَّلُ الْمُسْلِمِينَ
Say: “Verily, my prayer, my sacrifice, my living, and my dying are for Allah, the Lord of the Worlds. He has no partner. And with this I have been commanded, and I am the first of the Muslims.” (6:162-163)
And due to His saying:
إِنَّا أَعْطَيْنَاكَ الْكَوْثَرَ فَصَلِّ لِرَبِّكَ وَانْحَرْ
Verily, We have granted you (O Muhammad (Peace be upon him)) Al-Kawthar (a river in Paradise); Therefore turn in prayer to your Lord and sacrifice (to Him only). (108: 1-2)
And due to the saying of the Prophet sallAllaahu `alaihi wa sallam: “Allah curses him who sacrifices to other than Allah.” (Reported by Muslim)
So slaughtering to the Jinn or to the inhabitants of the graves or other than them from the created things such as idols, stars, and their like – if the one performing the slaughter hopes for their intercession, or hopes that they will bring about benefit for him or repel from him an illness that he has or other than that, this is an evil and Shirk (polytheism).
Similarly the one who slaughters for his grandfather or his father believing in them that they will benefit him, or cure his ill, or draw him closer to Allaah due to his slaughtering then he is like the one that slaughters to the sun or the moon and the stars – all of that is Shirk (polytheism).
We ask for Allaah’s safety and security.