IMO:
"Sorry" probably came from the grunting sounds that accompanied the soothing and compensation. It then became associated with the concept of apology.
Then, they said "sorry" first and then went on to compensate.
When something was too minor to require work done or things given, "sorry"...