In gold mining, a ball mill is used for crushing and grinding ore to liberate and recover the valuable gold from the remaining material. The mill uses steel balls as the grinding medium to break down the ore into finer particles, creating a slurry which facilitates the extraction of gold. This process helps to increase the efficiency of the subsequent treatments, such as flotation and cyanidation, which are used to separate and extract gold from the ores.