There are many laws set by the sages in various scriptures for different castes and orders and for different situations. Disobeying them creates a sin. But sages have also prescribed expiations for persons who repent after committing a sin. So the prayaschittas are useful only if the person has repentance for what he has done (kṛte pāpe'nutāpo vai yasya pusaḥ prajāyate - VP 2.6.40).
It's true that the effects of Karma cannot be evaded, but it's inexorable only in that case when there is no method to evade it. For example, the effects of disease are unavoidable if no medicine is known or one doesn't take the medicine even after knowing it. So performing the prescribed prayaschita is another action that counter acts the effects of previous action. If prayaschitta is not done, then their corresponding punishment hell will have to be suffered as mentioned in the scriptures.
Apart from prayaschitta cleaning the body and the soul, it also restores back one's social status and brings back peace of mind:
tasmādyatnena karttavyaṃ prāyaścittaṃ viśuddhaye
evamasyāntarātmā ca lokaścaiva prasīdati [GP - 1.105.2]
Therefore, one should carefully perform prayaschitta for the purification of the inner soul. Doing so also makes people happy.
In earlier times and also in some villages today, people generally don't talk and mix with them who are known to have committed some sins. They are like outcasted from the society. So after performance of prayaschitta, they regain their previous social status.
Now regarding prayaschittas mentioned in the Vedas, I am not sure if there are expiations mentioned as vividly as in the puranas and other dharma sashtras. But there are certainly mentions of it found also in the Vedas, at least regarding expiations for fault in performance of sacrifice.
I found some links mentioning expiation in the Vedas from Net. One prayer is like below:
- From the sins which knowingly or unknowingly we have committed, do ye, all gods, of one accord, release us!
- If awake, or if asleep, to sin inclined, I have committed a sin, may what has been, and what shall be, as if from a wooden post, release me!
- As one released from a wooden post, as one in a sweat by bathing (is cleansed) of filth, as ghee is clarified by the sieve, may all (the gods) clear me from sin!
Some other links I found are are below: