Bhagavad Gita: Chapter 13, Verse 21

कार्यकारणकर्तृत्वे हेतु: प्रकृतिरुच्यते |
पुरुष: सुखदु:खानां भोक्तृत्वे हेतुरुच्यते || 21||

kārya-kāraṇa-kartṛitve hetuḥ prakṛitir uchyate
puruṣhaḥ sukha-duḥkhānāṁ bhoktṛitve hetur uchyate

kāryaeffect; kāraṇacause; kartṛitvein the matter of creation; hetuḥthe medium; prakṛitiḥthe material energy; uchyateis said to be; puruṣhaḥthe individual soul; sukha-duḥkhānāmof happiness and distress; bhoktṛitvein experiencing; hetuḥis responsible; uchyateis said to be

karya-karana-kartritve hetuh prakritir uchyate
purushah sukha-duhkhanam bhoktritve hetur uchyate

Translation

BG 13.21: In the matter of creation, the material energy is responsible for cause and effect; in the matter of experiencing happiness and distress, the individual soul is declared responsible.

Commentary

The material energy, with the direction of Brahma, creates myriad elements and forms of life that compose creation.  Brahma makes the master plan and the material energy executes it.  The Vedas state that there are 8.4 million species of life in the material world.  All these bodily forms are transformations of the material energy.  Hence, material nature is responsible for all the cause and effect in the world. 

The soul gets a bodily form (field of activity) according to its past karmas, and it identifies itself with the body, mind, and intellect.  Thus, it seeks the pleasure of the bodily senses.  When the senses come in contact with the sense objects, the mind experiences a pleasurable sensation.  Since the soul identifies with the mind, it vicariously enjoys that pleasurable sensation.  In this way, the soul perceives the sensations of both pleasure and pain, through the medium of the senses, mind, and intellect.  This can be compared to a dream state:

ehi bidhi jaga hari āśhrita rahaī, jadapi asatya deta duḥkha ahaī   (Ramayan)

jauṅ sapaneṅ sira kāṭai koī, binu jāgeṅ na dūri dukh hoī   (Ramayan)

“The world is sustained by God.  It creates an illusion, which, although unreal, gives misery to the soul.  This is just like if someone’s head gets cut in a dream, the misery will continue until the person wakes up and stops dreaming.”  In this dream state of identifying with the body, the soul experiences pleasure and pain in accordance with its own past and present karmas.  As a result, it is said to be responsible for both kinds of experiences.