Cash registers were invented to prevent stealing by store clerks. James Ritty invented it in 1884. They were not mainly adding machines, but registers of sales so the owner could keep track of what was going on. In those days, any clerk could add quickly anyway. Paper receipts were a later improvement.
They were complex mechanical machines (still are, but not mechanical). The old National Cash Register Co. (NCR) is still in business. IBM's Tom Watson started out there.
I spent a few minutes trying to find out how they were designed, but gave up. The Wiki entry is quite lame. Disappointing.
The days of the ka-ching are long gone. The purpose of the ka-ching noise was to let the owner or manager know that a sale had taken place.