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 fertiliser pellets.
Fertiliser 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 fertiliser sprinkled on top of the soil. These pellets are usually yellow. As you water your plant, the shell of the fertiliser pellet begins to dissolve and release the plant nutrients. Some potting soils even have slow-release fertiliser pellets mixed in. Sometimes these pellets contain liquid fertiliser.
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 colour. A seed may have its outer shell removed, making the round yellow inner layer difficult to identify as a seed.
Mould can grow in many shapes and colours. If the conditions are right, certain kinds of mould can grow on the surface of the soil. Soil near decaying compost is particularly likely to contain mould. Some mould can look like small yellow balls. Since mould is delicate, these structures should be easy to crush and identify as mould. Mould can be toxic. If you have yellow balls of mould in your soil, mix it into the ground. If you find yellow balls of mould in a houseplant, remove the soil and throw it away.
It is not common, but sometimes small plastic beads are added to speciality soil mixes. Perlite is a common soil additive found in most potting soil. Old perlite can become discoloured. Since perlite is normally little white balls about 3 mm (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.