These are ordinary English words and phrases that you should be able to find in a dictionary, for example:
when (also if) it comes to it and variants: when (or if) the time comes for essential, decisive, or important action; should it become (absolutely) necessary; ultimately.
Put (a person) to it. To force, challenge, or require (a person) to do something indicated by the context.
Ill-treatment. Bad or unfavourable treatment; rough handling; harsh or unsympathetic dealings.
Oxford English Dictionary
In the particular case of grief, the usual meaning of the word in the mid-20th century was ‘Deep or violent sorrow, caused by loss or trouble’, but Tolkien was a scholar of Old English, and particularly fond of archaic vocabulary, so I suspect that what he had in mind here was the (then obsolete) meaning ‘hardship, suffering’.
So the meaning of the passage is that although a casual acquaintance with Hobbits gives the impression that they cling to their comforts, in fact they have hidden qualities of toughness, endurance, and bravery, that are revealed in case of need: that is, when they are put to it.
This passage is an important piece of foreshadowing, because in the course of chapter 2 we learn from Gandalf that for sixty years Bilbo Baggins has been possessed of a Ring of Power, which is ‘perilous’:
‘A mortal, Frodo, who keeps one of the Great Rings, does not die, but he does not grow or obtain more life, he merely continues, until at last every minute is a weariness. And if he often uses the Ring to make himself invisible, he fades: he becomes in the end invisible permanently, and walks in the twilight under the eye of the dark power that rules the Rings. Yes, sooner or later—later, if he is strong or well-meaning to begin with, but neither strength nor good purpose will last—sooner or later the dark power will devour him.’
The Ring is too dangerous for Gandalf to accept:
‘Do not tempt me! I dare not take it, not even to keep it safe, unused. The wish to wield it would be too great, for my strength.’
At this point a reader who is paying attention will ask how, if the Ring is so dangerous, can Bilbo have possessed it for sixty years and suffered no more than growing ‘thin and stretched’? The passage from the Prologue provides us with the answer: that Hobbits are ‘curiously tough’ in some ways, and perhaps (we guess) resistance to the power of the Ring is one of those ways.