What do the numbers of shimano components mean? Shimano components have numbers, presumably to denote quality. E.g. Dura Ace stuff has numbers like 7700, 7800, or 7900. An Ultegra might have 6700 or 6800 on it. A 105 might have the number 5600 or 5700 attached.

Obviously the first number indicates the product-line. What is the second number? Are these the only components with numbers, or do tiagra, sora, and lower get these numbers too?

What does it all mean?
These are just editions of specific product lines. It's the same as BMW with the 3-series, 5-series and 7-series. Let's take Shimano Dura-Ace, for instance. It's traditionally a 7000-series of product numbers.

7200 - 1978-era Dura-Ace

7400 - Mid-to-late 1980's

7700 - 9-speed Dura-Ace ~ late 1990's

7800 - 10-speed Dura-Ace ~ 2000's

7900 - Current 10-speed Dura-Ace

And from wikipedia, For 2011, road bicycle groupsets include:

Dura-Ace Di2 [7970] (10 speed electronic)
Dura-Ace [7900] (10 speed)
Dura-Ace Track [7700] (NJS-approved, which is a requirement of all bicycle components used in professional Keirin racing in Japan)
Ultegra Di2 [6770] (10 speed electronic)
Ultegra [6700] (10 speed)
105 [5700] (10 speed)
Tiagra [4600] (10 speed) 9 speed on older models
Sora [3400] (9 speed)
2300 [2300] (8 speed)