It doesn’t “know” that. It is actively Reacting to your environment.
When you work with your hands-in whatever way, lifting weights, swinging an axe, carrying things, whatever-you cause Tony tears and damage to your skin.
Calluses form as a response to that area of your skin being repeatedly damaged like this, not because it “knows” you need a callus there ahead of time. So if you stopped damaging your skin, your body would stop forming calluses. There are just some places on the body that get used and damaged a lot, like the palm/fingers of your hands.
Edit: tiny not Tony
Latest Answers