Batiks on the other hand refer to the coloring process. Similar to the method used to make psychedelic tie-dyes from the 60s, fabric is bound then dipped in dye. Tie-dyes often use rubber bands to control coloring, whereas batiks use wax. After drying, the wax is removed and the process can be repeated many times, changing the pattern of the binding and color of the dye. Wax is applied manually with a pen-like tool called a canting or with a copper stamp in a repeating pattern. The stamp method is obviously much faster, but constrains designs. Speed and flexibility can be obtained by using both methods on a single piece of cloth.
To summarize, a sarong is just a piece of fabric of a certain size but batik is a wax-based coloring method. A batik is often a sarong, but a sarong isn't necessarily a batik. Quite the contrary. Even a one-color piece of fabric with no pattern can be a sarong. This is what’s loaned out to tourists for a small donation at temples. Most of the multi-color sarongs in the market of Ubud, Bali are cheap prints made in a factory like T-shirts. How do you tell the difference?