Short answer
Plants typically store energy in the form of starch. Animals, including livestock and humans for that matter, can digest starch, metabolize it into acetyl-CoA and turn it into fat.
Background
Plants contain sugars, formed by photosynthesis. Plants generally do not store energy in the form of fats, but in the form of starch, a glucose polysaccharide*. Animals digest this starch through hydrolysis catalyzed by the enzyme amylase back into glucose (Fig. 1). Cellulose is another polysaccharide. In grass-fed cattle, it is mainly cellulose that forms their source of energy. Cellulose cannot be digested by ruminants (cattle, goats, sheep) as they are unable to synthesise the enzymes needed to digest cellulose and other plant compounds. Cellulose can be hydrolyzed by cellulase enzymes in e.g. Ruminococcus species present in the ruminant tract in the guts of these animals. The cellulase enzyme endoglycosidase cleaves the disaccharide cellobiose from cellulose, and another type of enzyme, β-glucosidase hydrolyzes cellobiose into glucose monomers (sources: Microbe Wiki, University of Waikato).
Glucose is then degraded to pyruvate by aerobic glycolysis in the cytoplasm of the cell. Pyruvate is then transported into the mitochondria, where pyruvate dehydrogenase oxidatively decarboxylates pyruvate, forming acetyl-CoA and other products (Fig. 2).
Acetyl CoA can then serve as a substrate for citrate synthesis. Citrate, in turn, can be transported out of the mitochondria to the cytoplasm. There it can be split to generate cytoplasmic acetyl-CoA for fatty acid synthesis under the influence of anabolic factors like insulin in times of plenty (Fig. 3), referred to as lipogenesis.

Fig. 1. Starch is hydrolyzed by amylase. source: Biotek

Fig. 2. Acetyl-CoA formation. source: University of Utah

Fig. 3. Lipogenesis. source: Sharing in Health
*: Although plants usually store their energy reserves in the form of starch, there are important exceptions to this. Most notably certain seed pods, like peanuts and walnuts, contain substantial amounts of fat. Further, cell membranes and other components will add traces of fatty substances even in grassy plants. With credits to Marzipanherz.