Because it is composed of a generally transparent material, diamond lets light pass through it, even in its most rough condition. But early on in history, stone cutters realized that you can get extra sparkle if you facet the diamond, and they set about finding out the best combination of facet size and shape and angle to get the most sparkle. Eventually, one design with 58 facets was shown to be the most efficient way to maximize the stone's best qualities and this became known as the ideal cut. It remains the industry standard, and is the shape that most people recognize as being a diamond shape.
This does not mean that diamonds of the same size are equal when it comes to cut. A lot depends on the skill of the diamond cutter as even the slightest variance in the angle of a single facet or its size or its effect on the symmetry of the stone will affect its value. Diamond cutting is part art but within the confines of exacting scientific boundaries.
This does not mean, however, that the diamonds that are cut to an ideal shape are automatically the best. Not at all. Part of he job of a highly skilled cutter is to determine what shape will be the best one to create the largest possible polished diamond from a given piece of rough. And rough diamonds come in all kinds of shapes. So a pear- or emerald-shaped diamond has as much claim to being perfect as the ideal cut, particularly if it produced a larger stone. In fact, most of the world's biggest, most famous diamonds are not ideal cuts because the chief goal was to maximize their size.