Originally, “halyava” referred to the shaft of a boot. The shaft of the boot lasts longer than, for example, the “head” (the part that protects the rise of the foot and wears out faster when walking).
Therefore, in olden times, cobblers would not always sew completely new boots, but would detach the worn parts and sew fresh ones to the old shaft — they worked “on halyava”, meaning with fewer expenses. Thus, “halyava” became synonymous with saving, and also synonymous with an item that was obtained for free.
Another version for the modern meaning of “halyava” is related to the fact that it was convenient to quickly put or hide something in a boot with a wide shaft — like in a pocket.
For instance, seminary students (bursaks) would place behind the shaft (“on halyava”) whatever they managed to pilfer at the market. Hence, “halyava” came to mean anything that was obtained for free, and later anything that was achieved without much effort.