They often use a combined grain filler/stain IIRC. Being far thicker than a liquid stain, this is going to be less prone to running into any cracks. It’s applied, goes on an hour-long conveyor ride around the ceiling level of the factory where it’s hot enough to dry it thoroughly without heat being specifically applied, and the excess filler is then removed.
Bit that’s probably for the back, sides and neck of mahogany-bodied guitars rather than maple tops. Certainly using tinted lacquer is a lot easier and less risky than staining if you’ve got binding.