When you handle your new hermit crab for the first time, take into account what has been happening to your crab in the weeks before it came to you.
Natural Environment Wherever it lived before--somewhere warm and humid near an ocean--it had natural enemies, such as seagulls. Hermit crabs are relatively low on the food chain, and they protect themselves from their many predators by hiding in their shells. A predator might notice a crab due to movement--by sight, or by the sound of its passing. The crab notices the predator by sight, or smell, and ducks into its shell. The predator will soon give up, seeing no more movement, hearing no more sound, unable to notice much about one particular unmoving shell amongst many shells and shell-pieces and rocks on or near the beach. When you first handle your crab, think like your crab: you could be a very large predator, swooping down on it, picking it up off of the solid earth. Even your shadow is enough to frighten a crab--like the shadow of a swooping seagull. When I take out my newest crabs, I always put them on the floor (they can't fall off) and stay far enough back from them so that my shadow doesn't fall upon them, and my movements aren't quite enough to scare them back into their shells. That way, they can explore the safe space of the open floor, getting used to the sights and smells of their new environment for several days before actual handling.
Transport and Distribution Finally, somewhere in its very recent past, a predator did catch your hermit crab: a human, intending it to end up in a pet shop somewhere. Your crab is gathered together with hundreds of others. I'm not sure of the exact process of transport, but I can guess that the crabs are packed together in a fairly small space for an unknown length of time as they are transported. In this small space, some crabs won't be able to handle the stress of capture and transport, and will die. Others will be attacked by larger crabs or by crabs wanting their shells; more will die. Crabs who are pre-molt or just post-molt will also have a high chance of dying during this stage. I imagine a lot of them do reach their destinations alive, or the whole process would be stopped for lack of profit.
One of the main distributers of hermit crabs to pet shops here in the u.s. is a company called FMR. They are also researchers, developing the best products and care tips to go along with the hermit crabs they sell. I know that, once the crabs reach the FMR buildings in Florida, they are set loose in a large wire enclosure that contains lots of shells, called a "shell- changing room." That's how many of the crabs you see in pet shops come to live in painted shells. Crabs are still crowded together (though I'm sure not as much as they are during initial transport from their tropical homes). They climb the wire sides of the shell-changing room, often happy to find a bigger, better, sturdier shell for themselves. Hermit crabs naturally fight over shells, however, and also tend to prey on the weaker and smaller crabs, as well as those at either extreme in the molting cycle. Again, most crabs survive--they are given good food and water, and a chance to find a good shell as a new home.
The Pet Shops FMR also sells products to the pet shops, possibly even to the very pet shop where your hermit crab finds you. So much at this point depends on the pet shop owners--how they care for their crabs before they are sold. They need a large, uncrowded space to live in to prevent sickness, shell fights, and further stress. They must have heat and humidity (something most pet shops know nothing about) and food and water dishes that they can actually climb into and out of with ease. I've seen so many pet shops with water dishes that are plastic and too big for small crabs to utilize, except to dig under. In cases of overcrowding, where crabs can't reach the food and water dishes (or can even drown in the water dish), where there are no extra shells provided, many more of these already stressed-out creatures will die. Crabs sent by FMR most likely go to decent places--they are sent with care instructions, and the pet shop owners have a suitable display cage they've bought from FMR, as well as good food and water, and decent dishes as well.
I've seen some horrible conditions in pet shops before; that's why I have so many hermit crabs. I call them "charity-crabs." You can find crabs who've left their shells from stress or a shell-fight and died. There are places that provide no extra shells, practically guaranteeing shell-fights and resulting loss of limbs and deaths. As mentioned above, there are problems with water dishes--so many crabs are so tiny, all they can do is hide under the water dish, not reach it. The cage substrate might be a thin layer of gravel, sand, or earth, dirty and filled with fungus. In the southern states, along the beaches, you can find these things and worse--hundreds of crabs packed into small wire cages. Frequently if you buy a cage, you get a crab for free, not the other way around--this shows you the value of the individual crab's life. I've seen crabs forced to cling constantly to the sides of a wire cage because there is no room for them on the ground, due to overcrowding.
Charity-crabs Even in great pet shops--those who take care of their crabs in this interim stage between their natural home and your home--there are still many stresses on the crabs. Most of the web sites I've seen directly tell potential crab owners to only pick the crabs who look healthy: shiny eyes, shiny exoskeletons, possessing all limbs and claws, good shell, etc. Yet so many of those crabs who are missing limbs can regrow them, given proper care. A missing leg or claw shouldn't be a death sentence. Neither should an improper shell--given a chance, a crab will gladly leave a too-small shell, one with holes in it, etc., for a good new shell. Crabs who can't reach the water-dish will have dull exoskeletons; the seven crabs I rescued from a pet shop with an unreachable dish kept returning and returning to the water dish in their new tank, and within a day, their skins were shiny and healthy again. Crabs with dull eyes might need a safe place to molt. In some cases, 'charity-crabs' are too stressed or injured to survive; in these cases, you can at least say you gave them food and water, and a safe, warm place to pass on in peace. Most of the charity-crabs I've bought have survived and even thrived, re-growing lost limbs in the next molt, finding better shells, and discovering themselves in a place where they no longer have to be stressed constantly. So I recommend the purchase of those crabs, especially, who need a little extra help to survive, especially to experienced "crabbers."
Coming Home Finally... your trip to the pet shop. Hopefully a good store, with healthy crabs, especially if you are a new crab owner. Just remember that your hermit crabs need some special care right after you first bring them home. Keep the new crabs in isolation for at least a week. If the conditions at the pet shop were especially bad, give the new hermies a few baths. (It is safe to keep the new crabs together in isolation, so long as you don't see any problems between specific crabs.) Bathing to wash away dirt and possibly mites or mold from their long journey and time spent at the pet shop. Bathing will also help to restore shell-water and add moisture to the exoskeleton. If you already have other crabs, bathe them all on the day they are to be combined into the main tank--they will then all smell the same and this will help keep them from fighting each other. They are territorial creatures and new crabs are seen as invading the old crabs' territory. Remember to let your new crabs adjust to their new surroundings before you even begin to hold them. Let them have a few days, a week, to explore their isolation tank and then their main tank.