Gem thieves

Gem thieves will come aboard a ship and steal gems if the gems have been left unattended or if you have 25 or more gems in the hold.

Unattended gems
Gems that are left unattended in a ship's hold for 15 minutes are automatically stolen. However there appears to be an issue where if the gems are unattended within 15 minutes of a system reboot, the gems are never stolen. If someone boards the ship following the reboot, even hours after the reboot, the gems would still be in the hold. However someone boarding the ship would also reset the timer, and once that pirate leaves the ship, the 15 minute timer begins anew.

Gems stolen during transport
If you have 25 or more gems aboard your vessel, the gems are stolen at a predictable rate.

The number of gems stolen is determined based on how many gems are in the hold, dividing by 25 and rounding down. Mathematically the number of gems stolen equals, where Gs is the number of gems stolen from the hold, and Gt is the total number of gems in the hold across all categories.

The number of gems stolen has been determined by several pirates by looking at the vessel records for various gem runs to see when gems were stolen and how many were taken.