"The 5 Series began the BMW tradition of being named with a three-digit number. The first digit (5 in this case) represents the model, and the following two digits (usually) represent the size of the engine in decilitres, which is the main distinguishing difference. Additional letters or words may be added to the end of the three-digit number to define the fuel type (petrol or diesel), engine or transmission details, and the body style. The 'i' originally stood for (fuel) 'injection'."
-Wikipedia