Pellets (aka agar, rainbow pellets) are little dots in different colors that spawn randomly all over the map. Initially they give 1 mass when eaten, but can grow in size over time and give more mass then.
Eating pellets is the most common way to gain mass. The other ways include: eating other cells, eating a virus (when large enough to eat them) and eating W mass ejected from other cells. Since cells lose mass over time, big cells can not eat pellets to gain more mass.