The Buddha tells Kassapa that if you believe that the one who acts is the same as the one who experiences the result (so karoti so paṭisaṃvedayati), then you must believe in a lasting entity, and this amounts to eternalism (sassataṃ etaṃ pareti). If you believe that the one who acts is other (añña) than the one who experiences the results (añño karoti añño paṭisaṃvedayati), then this amounts to nihilism (ucchedaṃ etaṃ pareti). Suffering in fact arises in dependence on causes. The Buddha teaches Kassapa about the 12 nidanas - ignorance gives rise to volitional tendencies, which gives rise to consciousness, etc. This, he declares is the origin of this mass of suffering (dukkhakkhandhassa).
Kassapa finds this illuminating and asks to join the bhikkhu Sangha. The story has other interesting features, but let's go back and work through the exchange I've just outlined. Sayaṃkataṃ can mean "created by oneself" (which is how Bhikkhu Bodhi translates it) or it can mean "made by itself". PED also suggests "spontaneous" as a possibility. To me it seems more likely that Kassapa is asking whether suffering causes itself, rather than do we cause our own suffering. This fits the context as we will see.
Now the Buddha responds to Kassapa's question about how suffering occurs by first critiquing two wrong views about the relationship between acting (karoti) and experience (paṭisamvedeti). By the way: acting (karoti) produces an action (kamma) both of which come from the root √kṛ - 'to do, to make'. And action according to the Buddha is intention, ie it is the motivations, the subjectivity, behind actions that he is interested in. To emphasis a point I have been making repeatedly lately, the link here is between intention and experience. Paṭisaṃvediyeti comes ultimate from the verbal root √vid 'to know or feel'. Vediyati is a form of the the causative, and therefore means something like 'informs', but it's clear that it refers to experiencing sensations. Vediyati is related to the important word for sensations vedanā (literally: announcing or making known). The suffixes here (paṭi + saṃ) don't seem to change the meaning very much. Paṭi perhaps makes it reflexive, and saṃ can mean together or complete. In any case paṭisamvediyati refers to the experience of sensations or vedanā. So the context here is the subjective pole of both actions and consequences, not the objective side of the equation - bodily actions and things in the world.
Kassapa sees two basic possibilities - suffering is either self-made, or not-self-made. It seems that the Buddha interprets the former as saying that one who acts and and the one who subsequently experiences are identical; while the latter is saying that actor and experiencer are not linked. Indian logic also allows for both and neither to be the case. But neither the two basic cases, nor both, nor neither apply. Now because Kassapa is a naked ascetic and for some complicated reasons about the way he asks his questions, we can assume that he is a Jain.
Like most Indians of the time the Jains believed in a kind of rebirth. All forms of rebirth theory present one major difficulty. What links one life to another? If there is something which continues from life to life, then that is eternalism; and if there isn't then rebirth isn't really rebirth, and we only have this one life, which is nihilism. If one is concerned with exhausting karma in order to be liberated, a more specific question arises because if one dies what then is the link between actions and consequences? The Jains believed that humans possess a jiva, or life energy, which continues from life to life. The image for the way the jiva operates is that actions (kamma) produce dust, which sticks to the jiva weighing it down. Liberation can be achieved by removing the dust (through the experience of suffering) and by not creating any new dust - that is by not acting. The Jains believed that all actions - whether intentional or not - created dust. In addition they believed that all things possess some kind of consciousness, so eating even vegetables was causing harm. It was the Jains who first adopted the practice of ahiṃsa - non-harm. Many of the austerities carried out by Jains consisted primarily in non-action - long periods of immobility, extreme fasting, and holding the breath for example. Going naked meant not having to harm plants or animals for the sake of clothing. The idea was that through painful austerities one "burned up" one's karma, removing the dust from the jiva and allowing it to float up and be liberated.
Several suttas in the canon portray the Jain Sangha falling into dispute and confusion after the death of their leader Mahāvīra. This may be polemical, but it might provide the context for a Jain asking advice of the Buddha, and for being in such a hurry to know. Note that Kassapa is not asking "why do I suffer?" in any abstract way. He is asking really concerned with the question - "how do I understand suffering in order to be liberated from it?" In other words his outlook is not much different from a Buddhist, he just lacks the insight of dependent arising - which the Buddha tells him about.
So the question about the link between actions and consequences, and the origins of suffering have the same answer. Experiences, of which suffering is the paradigm for the unliberated, arise in dependence on causes. The key aspect of this is that when we experience pleasurable sensations (vedanā) we desire more (taṇha). This craving provides fuel (upādāna) for continued becoming (bhava). This results in the cycle of birth (jāti) old age and death (jarā-maraṇa) - that is to say that it causes us to suffer since all unenlightened experiences are (unsatisfactory) dukkha. Only if we understand this process, can we then begin to interrupt it because although vedanā is involuntary, taṇha is not.
We often choose the wrong course of action because we think that pleasure is happiness. We want happiness, but we pursue pleasure. In fact it is a double bind, because not only do we pursue pleasure, but the way offered by the Buddha appears as if it may not be entirely pleasurable: we have to give things up, we have to be disciplined etc. And because we also avoid discomfort we won't commit ourselves to practice while we see happiness in terms of pleasure. It's not until we really begin to see where happiness lies that we are able to overcome this reticence: to give up what must be given up, and to take up what must be taken up. Often we must do a lot of study and engage in discussions and debates to get to this point. We have to take apart our views about happiness in order to make room for practice. And a third fetter may have been put in place by this point. We may have burdened ourselves with many commitments by the time we come to our senses. We for instance have families and careers that we have a responsibility to. So then finding a compromise between our practice and our responsibilities can be quite difficult. But still it is important to understand what we are doing and why. We have this experience because it has arisen in dependence on causes. We have a choice about what conditions we set up in the future - so we can always practice to some extent.
*This story is from the Acelakassapa Sutta, Saṃyutta Nikāya 12:17 (PTS SN ii.18 ff). It can be found on page p.545 in Bhikkhu Bodhi's translation (single volume edition). The Sutta is also translated by Bhikkhu Thanissaro on Access to Insight. (Note that Thanissaro translates dukkha as 'stress' which can be a bit confusing).image: modern day naked Jain asetics by Freddy Nagarvala.