The grass contains chemical energy, which is stored in the bonds between the atoms that make up the grass. When the goat eats the grass, it breaks down these bonds and releases the chemical energy. This energy is then used by the goat to power its body's activities.