People find yellow balls in the soil for several possible reasons. You may have found one in the pot of a houseplant and wondered what it was. You may have even squeezed it and it exploded releasing a little bit of liquid. You may have also found small pieces of yellow balls that have been broken up, making you think they were some kind of eggs. Yellow balls found in your soil are likely just slow-release fertilizer pellets.
Fertilizer can be mixed with water and sprayed on the soil or it can be encapsulated. Houseplants are often sold from nurseries with a small amount of slow-release fertilizer sprinkled on top of the soil. These pellets are usually yellow. As you water your plant, the shell of the fertilizer pellet begins to dissolve and release the plant nutrients. Some potting soils even have slow-release fertilizer pellets mixed in. Sometimes these pellets contain liquid fertilizer.
Depending on where your soil is, it may be exposed to plants that have seeds that look like small yellow balls. Legumes have seeds that look like yellow balls. There may be varieties of weeds that have seeds that are round and have a yellow color. A seed may have its outer shell removed, making the round yellow inner layer difficult to identify as a seed.
Mold can grow in many shapes and colors. If the conditions are right, certain kinds of mold can grow on the surface of the soil. Soil near decaying compost is particularly likely to contain mold. Some mold can look like small yellow balls. Since mold is delicate, these structures should be easy to crush and identify as mold. Mold can be toxic. If you have yellow balls of mold in your soil, mix it into the ground. If you find yellow balls of mold in a houseplant, remove the soil and throw it away.
It is not common, but sometimes small plastic beads are added to specialty soil mixes. Perlite is a common soil additive found in most potting soil. Old perlite can become discolored. Since perlite is normally little white balls about 1/8 inch in diameter, old ones that have turned yellow will look like yellow balls. Other soil additives such as vermiculite, which is in most potting soil, start out slightly yellow, but if it is rubbed or rolled in a certain way, it can be formed into what might look like yellow balls.