A formula is a ratio of atoms, and like any ratio it can be reduced. Glucose, C6H12O6, has 6 carbon, 12 hydrogen and 6 oxygen atoms; dividing by 6 gives 1 : 2 : 1, so its empirical formula is CH2O. Formaldehyde (CH2O) and acetic acid (C2H4O2) reduce to the same CH2O, so an empirical formula tells you the proportions but not which compound you have.
Lab data come as masses, not atom counts, so you convert to moles, which are counts. For a compound that is 40.0% C, 6.71% H and 53.3% O, take a 100 g sample: 40.0 g of C, 6.71 g of H and 53.3 g of O, or 40.0/12.01=3.33 mol, 6.71/1.008=6.66 mol and 53.3/16.00=3.33 mol. Dividing by the smallest, 3.33, gives 1 : 2 : 1, which is CH2O again.
Two things are easy to confuse with the empirical formula. The molecular formula gives the actual number of atoms in one molecule; it is the empirical formula times a whole number, found by dividing the molar mass by the empirical formula's mass. And a mole ratio like 1 : 1.5 is not a finished answer: multiply everything by 2 to get 2 : 3. Round only values within about 0.1 of a whole number; ratios ending in .5, .33 or .25 are signals to multiply by 2, 3 or 4.
Think of it like this. A team that "won 2 games for every 1 lost" could have gone 2-1, 10-5 or 20-10; the reduced ratio fits them all. An empirical formula is that reduced ratio for atoms. One more fact, the total games played, recovers the actual season, just as the molar mass turns an empirical formula into the molecular formula.
Core idea. Mass data become atom ratios once each mass is converted to moles. The empirical formula is the smallest whole-number version of that mole ratio, so it gives a compound's proportions but not the size of its molecules.