It is narrated from Umm al-Mu’minin Sayyida Aisha (may Allah be pleased with her) that the Prophet (peace and blessings be upon him) said: “When the night meal is served and the Isha prayer is established, then eat the night meal first.” Abu Ja’far says: Muhammad bin Idris Shafi’i (may Allah have mercy on him) states that people were commanded to pray in congregation because of its superiority over praying alone, and permission to miss the congregation was also given for a specific reason (which is mentioned ahead), and that if the night meal arrives and the prayer is established (then there is a concession), or if there is a need for ablution, such as the urge to urinate, then it is prohibited to pray in that state. However, if one does pray in these conditions, the prayer will be valid, but the concession is given due to the excuse. The preferred thing is to pray when there is no tension, the heart is not distracted elsewhere, and there is no haste, rather (the prayer should be performed in the most complete and peaceful manner). It is generally known that when people pray in a state of tension, they pray hastily and their mind and heart are elsewhere. This is the same condition of one who comes to prayer leaving his food, especially a fasting person who has been hungry all day and is in severe need of food (i.e., all these things distract from prayer, whereas prayer is the name of tranquility and attention).
Hadith Referenceالسنن المأثورة / باب ما جاء في الأذان / 144
Hadith Takhrijصحیح بخاری، الاطعمة، باب اذا حضر العشاء فلا يعجل عن عشائه، رقم: 5465؛ صحیح مسلم، المساجد ومواضع الصلاة، باب كراهة الصلاة بحضرة ... الخ، رقم: 557