Bhagwad Gita
Chapter 14, Verse 15
रजसि प्रलयं गत्वा कर्मसङ्गिषु जायते।तथा प्रलीनस्तमसि मूढयोनिषु जायते।।14.15।।
When someone dies while influenced by passion, they are reborn among those who are focused on achieving results from their actions. On the other hand, if someone dies under the influence of ignorance, they are reborn in the form of animals.