A method of distributing data over a network created by Leonard Kleinrock between 1959 and 1962 that was used on ARPANET (Advanced Research Projects Agency Network). In packet switching, information is broken into small data segments known as packets and reassembled when received at the destination. Packet switching helps prevent small information sent after larger information from waiting until the larger information is sent. When information is broken into packets, packet size and speed of the line determine how long it takes to travel to its destination.
In the first example above, if your data were number 5, you'd wait for 1, 2, 3, and 4 (FIFO (first in, first out)) to complete. However, with packet switching, information is broken into packets, so with a small amount of information, you only need to wait a short time. In the second example above, it would take the number 1 longer to complete because it's bigger, which means it's broken into more packets. However, because number 5 is smaller, it would complete faster with fewer packets.