The chance mostly scales of your Entomology specialisation, although Stealth and Luck also play a part. If you gather during Night Time or while Invisible your chances increase significantly as well.
The exact calculation is Random Number 1-20, +1 per Luck, +1 Per Stealth, +2 per Entomology, +5 if Night Time, +10 if Invisible. If total number is above 20 then you succeed.