Beetles have been around for about 300 million years, and have diversified into many, many, many species. Maybe about 400,000 species. They have taken the basic insect plan, made a few changes, and have become phenomenally successful. Species of beetles can be found anywhere from underwater to the driest deserts, and anywhere in between.
Body Plan
The standard insect body plan consists of a head (which develops from several segments), the three segments of the thorax, and eleven-ish segments in the adbomen.
The head has sensory organs like antennae and eyes, along with mouthparts. Each thoracic segment has a pair of leg. In most insects, the second and third thoracic segments have a pair of wings as well. The abdomen contains the digestive organs, storage tissues and reproductive organs. The specific forms of the antennae, mouthparts, legs, wings, and so on, can vary considerably between different groups of insects.

Beetles have made some modifications to this basic plan that seem to have paid off. The mouthparts are almost always specialized for chewing (as opposed to sucking or piercing), with sturdy mandibles. One of the key modifications of the body is the conversion of the first pair of wings into (usually) hard, shiny protective structures called elytra.

When the beetle is walking or sitting still, the elytra cover the posterior thorax and much or all of the abdomen (depending on the species). In most species, the hindwings are folded under the elytra when not in use. For flight, the elytra are raised, the wings unfolded, and the beetle takes off.
With many thousands of species, one can imagine there are numerous variations on this basic theme. Mouthparts can be specialized for different foodstuffs, the legs can be adapted for life on different surfaces, the elytra can be long enough to cover the abdomen or very short, and so on.
Life Cycle
Like flies and moths, beetles undergo complete metamorphosis. They start life as a worm-like larva that feeds voraciously and grows (relatively) quickly. When it is ready, the larva turns into a pupa, which then undergoes metamorphosis to the adult form. Because they are well adapted to captivity and develop relatively quickly, the life cycle is easily observed in the “superworm,” Zophobas morio, shown below.

Beetle larvae have a wide variety of forms, but all are characterized by a long, cylindrical shape, and proportionally large abdomens. Their job after hatching is to eat and grow. A larva will go through several stages, or instars, which are punctuated by molts during which it builds a new, larger exoskeleton and then sheds the old one. When a larva reaches a particular size, which depends on the species and environmental conditions, it molts to the pupal stage and begins metamorphosis. Life as a larva can last anywhere from weeks to years, depending on the species and conditions.

The beetle pupa looks, appropriately enough, like a cross between a larva and an adult. The basic body plan of an adult can be seen, with the head, thorax and abdomen having more grown-up proportions. Details such as long legs are also apparent.
The pupa is not very active during this period, wiggling occasionally in response to disturbance. The real magic is happening inside. In a process that started even before the larva molted into a pupa, most larval tissues are dismantled and adult structures develop in their place.

After a period of time that depends on the species (about two to three weeks for Zophobas ), the pupa completes metamorphosis and undergoes its final molt to emerge as an adult. The term for emerging from the pupal skin is “eclosion” which is considered the beginning of adult life.
The exoskeleton of a newly eclosed beetle has not yet fully tanned, so it is light colored and soft. As the chitin and proteins in the skin (cuticle) undergo chemical reactions that harden and darken them, the beetle will take on its mature coloration.
Tenebrionid Beetles
Here in the arid Southwest, beetles in the family Tenebrionidae are extremely common and play important roles in their ecosystems. Known as darkling beetles, because they are… well… dark, they are largely detritivores, eating debris from plants and animals.
Darkling beetles include temperate species like the mealworm (Tenebrio molitor), and tropical species like Zophobas morio, above. Both of those species have wings, can lift their elytra, and, presumably, fly. I have never seen it, but I suppose it could happen.

Local Tenebrionids, like Eleodes, Philolithus, and Stenomorpha, cannot fly. Their elytra are sealed over their abdomens and their hindwings are vestigial. This is thought to aid in water retention. Unlike mammals, insects do not have lungs, and instead breathe through holes the their exoskeletons called spiracles, which are found in many segments of the thorax and abdomen.

One theory is that having the spiracles open into the subelytral space functions similarly to our upper airways and sinuses to reduce water loss. Another possibility is that the space allows for expansion of the abdomen enabling the beetle to drink and store larger volumes of water.

In any case, desert beetles such as the one from from Baja California shown above, have lost the ability to fly, presumably in exchange for improved survival in harsh conditions.