We present ab initio calculations of the atomic structure, the electronic density of states, and the photoemission intensities of the molten pentavalent semimetals As, Sb, and Bi. The investigations are based on pseudopotential-based interatomic forces, molecular-dynamics simulations for the liquid structure, and self-consistent linear-muffin-tin-orbital calculations of the electronic structure and photoemission intensities. We show that the anomalous structures of liquid As, Sb, and Bi arise from the modulation of the random packing of atoms by the Friedel oscillations in the effective interatomic potential. These modulations are damped by relativistic effects, which also lead to the formation of an s-p gap in the electronic density of states. The position and width of the gap are also shown to be related to the liquid structure. Trends in the atomic and electronic structures of the polyvalent elements across the Periodic Table are discussed.