The number of teaspoons to grams differs depending on density of the substance. While 1 teaspoon of sugar is equivalent to about 4 grams, 1 teaspoon of salt is about 6 grams. A gram of water is equal to 0.2 teaspoon, so 5 grams of water equals 1 teaspoon.
Grams and teaspoons measure two different things. Grams measure a material's mass. Teaspoons measure volume, or the amount of space that the ingredient occupies. Some ingredients, like salt and sugar, may have the same volume but their density and mass vary significantly. When using a general conversion with different ingredients, especially on a larger scale, the differences in mass can ruin a recipe.