This device looks like a inherently bad idea safety-wise, for the reason you found. I don't know what exactly is inside the handle, but you have to assume all it is doing is connecting wall power to a resistive heating element.
I imagine the outside of the heating element is intended to be insulated from everything else. (By the way, this has nothing at all do to with its ability to make heat. In fact, the heating element can't be made from a insulator else its resistance would be high and no heat would be generated.) Even if that insulation is intact and working, there could be some capacitive pickup from the input power to what appears to be a metal jacket of the heating element. This is what you may have felt.
However, if water got into the handle part, then all bets are off. It is probably sealed, at least enough to look sealed or pass some sort of test when new. I would be very careful to never let the handle part get wet anyways. Stuff happens. Does the power plug have two prongs or three? If three, maybe the metal jacket around the heating element is grounded. That would help in most cases, but can also make things worse in other cases.
Clearly something is already not right with this device if you felt a shock. I would ditch it, find a proper way to heat water, and move on. If think Murphy's law and the laws of physics don't apply to you, then at least only use this device on a circuit with a ground fault interruptor or with a separate isolation transformer.
No, there is no such thing as perfect insulation. All insulation is merely a very very high resistance with a high breakdown voltage
(Insulation is the ability of a material to block the flow of current through it, so that means that this material has a high resistivity. It is measured in Ωm.)
the current doesn't go via the rock,
Do you know where the current is lost, let say power supplied or
Power dissipated is $P=i^2R$,, and The effects of this electric shock are many, and most of them seem to do with neuropathy, that is, damage to the nervous system, including the brain.,
10mA through the heart can be enough to kill a person, regardless of voltage.
Now coming to your last part.
The fact that a current can flow through the materials you mention means that they're not full isolators. Soil is somewhat conducting as it contains water and that water will contain ions which can conduct electricity.
Best Answer
Trees are not as good an insulator as you might think. This source suggests a typical conductivity of living tree sap is 0.01 S/m with a relative permittivity of 80. So not an insulator, though a poor conductor. Typical advice when using electric fencing is that you do not use wooden posts! Presumably because wet wood is also conductive to some extent.
In any case, all that is required is that the tree acquired an electric potential and that you were more resistive than the path between the fence and you through the tree. It's the "volts that jolt". The current flow through the tree and you, would have been very small.
I would expect that the jolt would be maximised if you touched the tree near where it touched the fence or at least at the same height as where it touched the fence - thus minimising the resistance along the path to you.
EDIT: Oven dried wood has a conductivity of $\sim 10^{-15}$ S/m (i.e. 13 orders of magnitude lower), so it would be fair enough to call that an insulator for most practical purposes.