John Dalton's first new idea for his atomic theory, the Law of Multiple Proportions, describes the mass ratios in which the same elements combine to form different compounds.
CO and CO2 are both common compounds made of C and O. In modern times, we know them by their molecular formula, and understand that CO is literally one C bonded to one O, while CO2 is one C bonded to two Os. However, in the early 1800s, when Dalton was developing his understanding of chemistry, all scientists knew was that when C and O are mixed, multiple compounds are created. The bridge between understanding that C and O can form different substances together, and that those substances are literally combinations of individual atoms of C and O bonded together in specific ratios, was Dalton's Law of Multiple Proportions- the mass ratios of an element in two different compounds composed of the same elements are small whole numbers.
In this example, a mole of CO2 will have 32.00 g of O, while a mole of CO will have 16.00. Therefore, the ratio is 2:1, because those numbers correspond to the actual count of atoms of a certain element found in the molecule of a compound.