Boyles law states that at constant temperature' the volume of a given mass of a dry gas is inversely proportional to its pressure.
Most gases behave like ideal gases at moderate pressures and temperatures. The technology of the 17th century could not produce very high pressures or very low temperatures. Hence, the law was not likely to have deviations at the time of publication. As improvements in technology permitted higher pressures and lower temperatures, deviations from the ideal gas behavior became noticeable, and the relationship between pressure and volume can only be accurately described employing real gas theory.  The deviation is expressed as the compressibility factor.
Boyle (and  Mariotte) derived the law solely by experiment. The law can also be derived theoretically based on the presumed existence of atoms and molecules and assumptions about motion and perfectly elastic collisions (see kinetic theory of gases). These assumptions were met with enormous resistance in the positivist scientific community at the time, however, as they were seen as purely theoretical constructs for which there was not the slightest observational evidence.
Daniel Bernoulli (in 1737–1738) derived Boyles law by applying Newtons laws of motion at the molecular level. It remained ignored until around 1845, when John Waterston published a paper building the main precepts of kinetic theory; this was rejected by the Royal Society of England. Later works of James Prescott Joule, Rudolf Clausius and in particular Ludwig Boltzmann firmly established the kinetic theory of gases and brought attention to both the theories of Bernoulli and Waterston.
The debate between proponents of energetics and atomism led Boltzmann to write a book in 1898, which endured criticism until his suicide in 1906. Albert Einstein in 1905 showed how kinetic theory applies to the Brownian motion of a fluid-suspended particle, which was confirmed in 1908 by Jean Perrin.