Ecology and habitats
The division and lateral compression of the shell into two valves is clearly related to the adoption of a burrowing mode of life, which is achieved by a muscular foot. Primitive forms were detritivorous, whereas modern bivalves are suspension feeders that collect food particles from seawater using ciliated ctenidia (modified gills). The burrowing, filter-feeding mode of life restricts bivalves to aquatic environments.
Retention of the larval anchoring byssus into adult life has freed many bivalves from soft substrates, allowing them to colonize hard surfaces. This has also been achieved by cementation, as, for example, in oysters.
There are no pelagic bivalves, except for Planktomya hensoni, which is still benthic as an adult but has an unusually long planktonic larval stage. Some bivalves can swim, albeit weakly, when removed from the sediment, as can some file shells. True swimming is, however, seen only in the family Pectinidae (scallops) but is used mostly as an escape reaction.
Many representatives of the superfamily Galeommatoidea are commensal, a few are parasitic, and both have thus become miniaturized. Most bivalves are found in coastal seas, but their diversity is greatest on continental landmasses, where large rivers create suitable deltaic habitats and the continental shelf is broad. Except on tropical ones with coral reefs, few bivalves are found on islands.
Of the various subclasses, two are most important ecologically: the Heterodonta are modern burrowers that include cockles, clams, shipworms, and giant clams and feed primarily on suspended material. In contrast, the Pteriomorphia, an older group that is epibyssate (that is, anchored to rocks) dominates hard substrates. The subclass is made up of oysters, mussels, jingle shells, and others. Some of their older representatives are endobyssate (that is, anchored to material within a burrow or dugout), exposing their evolutionary history. Most of these two classes occupy a wide diversity of subhabitats, with simple reproductive strategies, external fertilization, and planktonic larvae to effect wide dispersion. They apportion the shallow-water marine domain virtually everywhere. The Palaeoheterodonta (a group that includes the unionids) are exclusively freshwater species, but all have significantly more complicated life cycles.

The Palaeotaxodonta (or Protobranchia) are coastal and deepwater detrivores, always infaunal. They share this diversity of habitat with the Anomalodesmata, which have radiated along two lines: shallow-water species that are highly specialized, are hermaphroditic, occupy narrow niches, and have a short planktonic stage and deep-sea species that are even more specialized, most being predators.
Most bivalves are primary consumers, typically exploiting organic material. The two dominant bivalve subclasses are high in the diet of many predators. Some 60 million years ago great adaptive radiation, notably in the Bivalvia, took place with a similar radiation in predatory crustaceans, starfishes, and snails. It is thought that such predation pressure effectively drove the Bivalvia underground with the resultant evolution of many antipredation devices on the shell—spines, ridges, and teeth—or of the habit of burrowing to great depths. On coral reefs a similar pressure led to deep boring into the fabric of the coral and the evolution of a host–borer intimacy.
Locomotion
Unlike in other molluscan groups, locomotion in bivalves is used only when dislodgement occurs or as a means to escape predation.
The bivalve foot, unlike that of gastropods, does not have a flat creeping sole but is bladelike (laterally compressed) and pointed for digging. The muscles mainly responsible for movement of the foot are the anterior and posterior pedal retractors. They retract the foot and effect back-and-forth movements. The foot is extended as blood is pumped into it, and it is prevented from overinflating by concentric rings of circular, oblique, and longitudinal muscle fibres, which also help to direct pedal extension and permit fine mobility.
During burrowing, the foot is greatly extended anteriorly from between parted shell valves. Taking a grip on the substratum, typically by dilation of the tip, the pedal retractors pull the shell downward. This is accompanied by sharp closure of the shell valves, forcing water out of the mantle cavity into the burrow, helping to fluidize the sediment, and making movement through it more efficient. So effective is this mechanism that fast burrowers, when removed from the sediment, can swim short distances.
Food and feeding
The primitive bivalve was almost certainly a detritivore (consumer of loose organic materials), and the modern palaeotaxodonts still pursue this mode of life. The posterior leaflike gills serve principally for respiration; feeding is carried out by the palp proboscides, which collect surface detritus.
The vast majority of other bivalves feed on the plant detritus, bacteria, and algae that characterize the sediment surface or cloud coastal and fresh waters. The gills have gradually become adapted as filtering devices called ctenidia. The primitive posterior respiratory gills have enlarged and moved to lie lateral to the body as paired folds, or demibranchs. Further increases in surface area have been achieved by folding the platelike gill lamellae into plicae. Each lamella comprises vertical rows of filaments upon the outer head of which are complex arrays of cilia that create a flow of water through the gill, form a filtration barrier, and transport retained particles to food grooves in the dorsal axes or ventral margins of the ctenidia. Bound in mucus, the food is transported to the mouth via the labial palps, where further selection occurs (see below Internal features).
Two groups of bivalves have exploited other food sources. These are the shipworms (family Teredinidae) and giant clams (family Tridacnidae). Shipworms are wood borers and are both protected and nourished by the wood they inhabit. They possess ctenidia and are capable of filtering food from the sea. When elongating the burrow, they digest the wood as well. In the Tridacnidae, symbiotic zooxanthellae (minute algal cells) are contained within the mantle tissue. The relationship between clam and algae is probably mutually beneficial, the algae having access to the dissolved waste products of the clam and the clam benefiting from the nutritional value of either culled zooxanthellae or their metabolic products.
A few bivalves are parasitic—e.g., species of Entovalva, which live either in the esophagus or upon the body of sea cucumbers (Holothuroidea), and the larvae (glochidia) of freshwater Unionidae, which parasitize fish.
The most exotic adaptations of the basic bivalve feeding plan are found in two groups of deepwater bivalves. These are scallops of the genus Propeamussium and the various deepwater families of the Anomalodesmata. In Propeamussium what appear to be typical ctenidia are present in the mantle cavity, but on closer examination these prove to be wholly atypical in that the filament heads are internal. The ctenidia are incapable of filtering. The gut is minute, and detected prey is sucked into the mantle cavity by an inrush of water when the valves open. The food is then pushed into the mouth with the foot.
Many deepwater Anomalodesmata have modified the typical bivalve ctenidium into a septum—the “septibranch” ctenidium—that creates pressure changes within the mantle cavity and produces sudden inrushes of water, carrying prey into a funnellike inhalant siphon (Cuspidaria). Food is then pushed into the mouth by the palps and foot. Others evert the inhalant siphon, like a hood, over the prey (Poromya and Lyonsiella). Prey items include small bottom-dwelling crustaceans, polychaete worms, and larvae of other benthic animals.
Associations
The greatest affinity of bivalves is with coral reefs. Indo-Pacific, but not Caribbean, reefs are the habitat of giant clams, Tridacna. Dead corals are bored by representatives of the Gastrochaenidae, living corals by species of Lithophaga. A greater degree of intimacy between living coral and bivalve borer is now known, some species associating with a single coral.
Similarly with wood borers: piddocks (Pholadidae) are more common in hardwoods, while shipworms (Teredinidae) favour softwoods. In the degradation of wood in the sea, a variety of species may colonize it with time and with depth.
One group of bivalves, the superfamily Galeommatoidea, form highly intimate relationships with other marine invertebrates, particularly on soft shores and coral reefs. Typically less than 10 millimetres (0.4 inch) long, most are commensal; i.e., they form an association in which there is no detriment to the host and exploit it for protection, food, and respiratory currents. On soft shores they share the burrows of polychaete worms and crustaceans, sometimes attaching to the body of the host.
Form and function
General features
The bivalve body comprises a dorsal visceral mass and a ventral foot, which is enclosed within a thin mantle, or pallium. The mantle secretes from its outer surface a shell divided into left and right valves. Between the body and mantle is the mantle cavity, within which hang the left and right gills, or ctenidia. The ctenidia are divided into two demibranchs, inner and outer, each in turn comprising inner and outer lamellae. Anteriorly, the ctenidia unite with paired (left and right) labial palps, which are food-sorting organs. The mantle margin can be fused at various places leaving medial apertures anteriorly for the extension and retraction of the locomotory foot and, in most bivalves, posteriorly to create inhalant and exhalant apertures that may be formed into siphons of variable length according to habitat. Foot and siphons can be withdrawn between the shell valves into the mantle cavity for protection.