The speed test is performed from a specific server, and is a really life scenario as it tries to download as much data as it can in a specified period of time. Based on the amount of data you download in the timeframe, it calculates the speed.
In most cases, the restriction is on your own internet speed, but in some cases (connecting to servers thousands of miles away) there are other restrictions.
The test is using megabits Technician. Divide the number by 8, and that is the download speed in megabytes (not bits) that you'll get.