Farmers place blocks of salt for livestock to lick. The block contains several of the animals’ mineral needs including sodium chloride (NaCl) which we humans use as table salt.
Animals know when they need salt. It’s different for each species. For example goats need plenty of salt because they’re descended from a mountain and maritime species. When I kept goats and made paneer, the whey tasted salty.
I’ve heard farmers say that the salt lick gets ignored for months at a time. But when the grass isn’t meeting all their needs, and when their pregnancy and lactation change their needs, the animals lick.