This trick works best with a crushed head or more than one clove of garlic. The reason why it peels easily is because of the friction between the cloves in the bowl. The dry fibrous peel is relatively brittle, so all the vigorous shaking inside the bowls helps to break it open along the seams. The clove being slippery, it slides out of the broken peel easily.
Onions contain amino acid sulfoxides that form sulfenic acids in the onion cells. Both the enzymes and the sulfenic acids are kept separately in the cells. When you cut the onion, the otherwise separate enzymes start mixing and produce propanethiol S-oxide, which is a volatile sulphur compound that starts wafting towards your eyes. This gas reacts with the water in your tears to form sulfuric acid, which in turn causes a burning sensation and stimulates the eyes to release more tears. Hence you end up with tears in your eyes when you cut an onion. By freezing it, you freeze the enzymes from mixing with the sulfenic acids and the production of propanethiol S-oxide is stopped. As a result, sulphuric acid is not formed when you chop the onions.