Everything has a particular shape. It's because of the various factors that are continuously affecting it.
for e.g.; a growing plant generally needs sunlight,air, and water for survival.
thus in order to gain sunlight it grow upwards while to gain water it penetrates deep into the soil.
In the same way apples are spherical; as it's easier for the embryo to form a circle(growing in all direction)
rather than growing in systematical way(like the edge turns of triangles and squares).