He was born in Wednesbury, Staffordshire but shortly thereafter his father, a successful merchant of ornamental ironwork, moved to a large property in London. William was his sole heir. He began to study medicine at University College London in 1880, but dropped out when he failed anatomy. Attracted to physiology, he studied under John Burdon Sanderson at Wadham College, Oxford, where he won a first class degree, investigating electrical changes occurring during salivary secretion. He returned to University College London in 1888 as an assistant to Edward Sharpey-Schafer. In 1890 he began to collaborate with Ernest Starling, who was at Guy's Hospital, on the electrical activity of the heart. They complemented one-another in many ways: for instance, Bayliss dealt with the recording apparatus while Starling worked with the preparation. Bayliss married Starling's sister Gertrude in 1893; they had three sons and one daughter. They enjoyed entertaining at their London estate, even hosting all those attending London meetings of the Physiological Society. He built a laboratory in a corrugated iron shed in his four-acre garden. He and Starling first studied pressures in the veins and capillaries, but in 1897 they radically changed direction to work on the control of the motility of the gut. Collaboration became easier when Starling moved to University College London as the Jodrell Chair of Physiology in 1899. It was known that injecting hydrochloric acid into the intestinal lumen evoked secretion by the pancreas; injection into the blood did not. They set out to determine which nerves were involved, but denervation did not block the response. In a flash of inspiration they ground up a sample of intestinal mucosa in sand containing hydrochloric acid; injecting the filtered extract elicited copious pancreatic secretion. They called the responsible chemical secretin and named such messenger chemicals hormones. A "discovery must, as it seems to me, ever rank as one of the landmarks of physiology—-the discovery not merely of a new thing, but of a new process of life". In 1903 he was demonstrating to the medical students an experiment on an anesthetized dog. Two visiting Swedish ladies believed that the anesthesia was insufficient and reported this to Stephen Coleridge, secretary of the anti-vivisectionist, his charges of torture were widely reported in the newspapers. The wealthy Bayliss had the resources to demand an apology, and when this was denied to sue for libel. The trial in the Brown Dog affair filled the newspapers, the jury found for Bayliss. Bayliss then studied the circulation of the brain and the action of enzymes, he was a founder of the Biochemical Society. In 1912 a Professorship in General Physiology was created for him at University College London. During the first years of World War I Starling was in the army, so Bayliss taught physiology and served on the Royal Society Food Committee. In 1916 he presented a paper on wound shock. It was known that in shock blood volume is decreased, even when the patient has not bled. This loss of blood causes the fall in blood pressure, because the heart has less blood to pump. This fall in blood pressure is responsible for the symptoms of shock. If blood volume is restored by injecting a salt solution then blood pressure rises, but only transitionally. Intravenous salt solutions had not helped men shocked during the Battle of the Somme. Using cats Bayliss demonstrated that if the salt solution contains five percent gelatin or gum arabic the rise in blood pressure is sustained and shock is alleviated. The explanation had been revealed earlier by Starling: molecules too large to escape from the blood plasma while it passes through the capillaries generate the osmotic pressure needed to pull fluid from the extracellular fluid back into the circulation. In November 1917 gum-saline was infused into wound shocked men who recovered. However, it was March 1918 before gum-saline was shipped to the front. No record was kept of how many were treated. The Germans adopted gum-saline, also without recording their results. Bayliss summarized this work in a book. In 1919 he published Principles of General Physiology, which he defined as those processes common to all living things. This influential book was "a revelation of the personality of the writer." It went through four editions and was revised after his death by his son Leonard and AV Hill, the fifth edition appearing in 1959-1960. An obituary noted that "His quiet generosity, his kindliness, his self-effacing modesty and his simple goodness endeared him to all his fellow physiologists" Another pointed out that Bayliss loved to have young physiologists about him and they loved his company because "His knowledge, though exhaustive, was never overbearing, and his genius was never frightening probably because his mind did not work rapidly."
Bayliss died in London in 1924. The Bayliss and Starling Society was founded in 1979 as a forum for scientists with research interests in central and autonomic peptide function.
Family
His son, Dr Leonard Ernest Bayliss FRSE was also a physiologist. who continued the family tradition of writing physiology textbooks.