It often relates to writing, recording, or measuring something.
Here are some examples:
* Grammar: The rules governing the structure and use of language.
* Telegram: A message sent by telegraph.
* Program: A set of instructions for a computer.
* Diagram: A drawing that explains something visually.
* Gram: A unit of weight (specifically 1/1000 of a kilogram). This is a secondary meaning that evolved from the idea of measuring things.
The word "gram" is versatile and appears in many words related to communication, information, and measurement.