One arrangement of carbon atoms
Diamond is made of nothing but carbon. What sets it apart from soft, dark graphite is not the ingredient but the arrangement. In diamond, every carbon atom forms four strong covalent bonds, one to each of four neighbors, and those neighbors sit at the corners of a tetrahedron around it. Repeat that pattern in every direction and you get a rigid, three-dimensional network in which the whole crystal is, in effect, one giant molecule.
This arrangement is usually called the diamond cubic structure. It can be pictured as a face-centered cubic lattice with a second, shifted copy of the same lattice interleaved with it, so that each atom has exactly four nearest neighbors. The bonds are short, and carbon atoms are small and light, which is a combination that turns out to matter for almost everything diamond does.
Why bonding produces hardness
Hardness, in the sense of resisting scratching and indentation, depends on how hard it is to push atoms out of their positions. In diamond, each atom is held by four short, strong bonds, and the bonds are spread evenly in all directions. There are no weak planes or loosely held layers in the bonding itself. To scratch diamond, you have to break or distort a large number of these bonds at once.
Compare graphite, also pure carbon. There each atom bonds strongly to three neighbors in a flat sheet, but the sheets are held together only weakly, so they slide over each other. That is why graphite works as a pencil mark and a dry lubricant, while diamond is among the hardest materials known. The same element, a different bonding pattern, opposite behavior. Graphite and diamond are just two of the carbon allotropes, and the differences between them come down to bonding geometry.
How hardness is actually measured, and why diamond sits at the top of each scale, is a separate topic. What matters here is the cause: dense, directional, uniform covalent bonding.
Stability and chemical behavior
Strong bonds also make diamond chemically stable. Most acids and bases leave it unchanged at ordinary temperatures, because there is little for them to attack: no easily removed ions and no reactive surface sites in the bulk. This is one reason diamond is used where corrosion resistance is needed in harsh environments.
Stability has limits, though. At high temperatures in the presence of oxygen, diamond can burn or oxidize, and in the absence of oxygen it can eventually convert to graphite when heated enough. At ordinary conditions graphite is actually the more stable form of carbon, but the change is so slow at room temperature that diamond lasts effectively indefinitely. Diamond is stable in practice because the barrier to change is high, not because it is the lowest-energy form.
Heat, electricity and light
The lattice that resists scratching also carries heat unusually well. Heat in diamond is carried mostly by lattice vibrations, and a stiff lattice of light atoms passes those vibrations along with very little scattering. Pure diamond conducts heat far better than most metals, yet it is an electrical insulator, because its electrons are tied up in bonds rather than free to move. That unusual pairing is the reason it is attractive as a laser heat spreader and in other electronics cooling roles.
The same tightly held electrons give diamond a wide gap between the energy states they can occupy, which is why pure diamond is clear. Light of visible wavelengths does not have enough energy to lift electrons across that gap, so it passes through. Diamond’s transparency, which suits diamond windows and diamond optics, reaches well into the ultraviolet and across much of the infrared, a range that few hard materials match.
What impurities and defects change
Real diamond is rarely a perfect lattice. A few foreign atoms or missing atoms can change color, electrical behavior and optical performance a great deal. Nitrogen is the most common impurity and often gives a yellow or brown tint. Boron, added deliberately, can turn an insulator into a semiconductor. These effects, and the way impurities are classified, belong to their own articles, but the principle is simple: the ideal lattice sets the baseline, and defects tune it.
Where the picture has limits
“Hard” does not mean “tough.” Diamond resists scratching extremely well but can still chip or split, because the strength of its bonds differs from one crystal direction to another and because it has almost no ability to deform plastically before breaking. This is a general feature of very hard, brittle materials, and it is why engineered forms of diamond are often made from many small grains rather than one large crystal.
Diamond also has practical weaknesses in use. It reacts with iron-group metals at high temperatures, which complicates cutting steel, and it degrades in air at elevated temperatures. Diamond-like carbon coatings, which contain much non-diamond bonding, behave differently from true diamond for the same reason. Knowing the structure helps explain why these limits exist, rather than treating them as surprises.
The short version
Four strong bonds per atom, arranged evenly in a rigid cubic network of light atoms, account for the main properties people associate with diamond: great hardness, high stiffness, efficient heat conduction, electrical insulation, chemical inertness and optical transparency. Most of the interesting engineering comes from the exceptions, where defects, grain structure, temperature or a particular chemical partner change what the ideal crystal would do.