An apology is what you say or do when you want to let someone know (or fool them into thinking) that you regret something. An apology is nice, but chocolates or large bundles of cash are nicer. Always.
The noun apology has its roots in the Greek apologos, meaning a story. It entered the English language in the Middle Ages. If you broke your friend’s sword and then made up an elaborate story to get out of trouble, that was an apology. After a few decades, the general sense of the word shifted to its current meaning — what you say when you want to express real remorse.