I believe the use of the cash tray has several reasons. The first is that it provides a convenient place to put the money. The bills and coins do not get scattered about the counter top by the other actions going on. Second, it provides a spot where both the buyer and seller can readily see and confirm how much is paid. The clerk will sometimes take the bills and count them in front of the buyer, announce the number, place the bills on the till, and then turn their attention to the coins. The clerk will often give the tray a little shake to make sure the coins aren’t playing hide-n-seek. At the end the clerk will usually announce how much they have been given.
When returning the change from the purchase, the clerk will usually count out the bills, often twice, hand over the bills and then hand over the coins. Occasionally, the clerk will hand over the bills with the receipt on top and the coins on top of that. I don’t care for this style.
In some stores the clerk will use the cash tray to return the change, but this is less common. The use of the tray when returning change from a purchase is seen where the cash register is a bit away from the counter; as in restaurants or some older stores or when multiple clerks are using the same register.
I would mention that in all the years I have lived in Japan I have never been short changed. At least that I know of.
I once had a clerk run out of the store to give me the 10¥ that I had mistakenly left behind.
Just yesterday, I was in a supermarket and the grandmother in front of me handed her purse to the clerk and let the clerk handle the entire exchange. Following this, another clerk came and bagged all the woman’s groceries and carried it outside for her. All the time the clerks carried on a cheerful talk about the weather and other innocuous things.
None of the other patrons batted an eye at this ‘special’ treatment. We dealt with our own cash transactions, using the cash tray, and bagged and carted off our own groceries happy in the knowledge that when we get old there will be people to look out for and help us.