I can fly to China in 24 hours! Why does a package take weeks?

The very short answer:
Parcels are handled in bulk as part of a mail stream of many items. This makes things much slower, but also much cheaper, which is why mailing a parcel costs about 1/50th as much as an airline ticket.

The somewhat longer answer:
Unfortunately, your parcel can’t walk itself up to a plane, check in for a flight, and fly itself to China. It gets moved with hundreds or thousands of other mailpieces at a time, and its trip to or from China might look something like this:

Day 1

Collection: mail from mailboxes and postal outlets is collected and brought to the local post office.
Transport to Sorting Facility: all mail is trucked to a regional mail processing center for sorting.

Day 2

Culling: mail is separated into letters, large envelopes (flats), and parcels.
Sortation: parcels are sorted into bins depending on destination.
Dispatch to OOE: international parcels are sent to an Outward Office of Exchange in order to be sent overseas.

Day 3

In transit: especially in larger countries, the trip to the OOE may be an airmail dispatch in itself.

Day 4

Arrival at OOE: parcels arrive and are unloaded.
Sortation: parcels are sorted based on destination country.
Marshalling: parcels are formed up into dispatches (shipments). They are put into mailbags, and a manifest listing all of the parcels and their particulars is drawn up.
Security screening: parcels are x-rayed, looking for anything that shouldn’t be going onto an airplane.
Outbound Customs: parcels may be screened to prevent things from being smuggled out of the country.

Day 5

Load: the dispatch is loaded onto the aircraft.

Day 6

Transit: in flight

Day 7

Arrival: the aircraft lands at its destination.
Unload: the mail is unloaded. The dispatch is brought to the destination country’s Incoming Office of Exchange.
Verification: the parcels are unpacked and their particulars verified to ensure they are all accounted for.
Customs: parcels are presented to Customs for inspection.
Release: parcels are released from Customs and returned to the postal service.

Day 8

Sortation: parcels are sorted based on destination.
Transit: mail is sent to local post offices for delivery.

Day 9

Final sortation: mail is sorted based on delivery routes.
Delivery: the happy customer, waiting patiently on their doorstep for the mailperson to arrive, receives their cherished parcel.

This all presumes everything goes smoothly; furthermore, the listed transit times are very short. In reality, transit times span many more days, and many other factors can also make things take longer:

Multi-hop routing:
Routing is a whole separate matter, but suffice it to say that “lowest cost” tends to win out over “fastest speed”. Mail shipments may transit many countries enroute to their destination.

Transportation delays:
Transportation delays are not uncommon — a truck may arrive late due to weather; a flight might be late because of a mechanical problem. However, many steps in the transportation process operate on a schedule. For instance, to get on a certain flight that departs at 11am, a parcel may need to reach the airport mail station by 1pm the day before. Missing a cutoff time means your parcel has to wait for the next dispatch, so it’s easy for a delay of a few hours to turn into one of a day or more.

Mail priority and volume:
If there is more mail than available space to send it, items of higher priority win out over lower ones. As a rule, express lettermail is the highest priority, followed by express packets and parcels, then ordinary lettermail, ordinary parcels, and finally SAL. So if you are sending a parcel via registered airmail, but there is a very high volume of EMS shipments that day, there may not be room for your item, and it’ll have to wait for the next flight.

During times of high mail volume, there is likely to be a backlog of shipments waiting to be sent. Your parcel, of course, starts at the back of the queue.

Customs & security delays:
Customs operates on their own schedule, and they don’t care how badly you want your package. Some places open and inspect almost everything, some don’t; some places process packages very efficiently, some do not.

With both Customs and security, if one item is suspicious, it may delay everything in the same dispatch.

Finally, none of the above accounts for accidents, like your parcel being misrouted, falling off a conveyor belt at one of the sortation plants, or being mistakenly left in the bottom of a mailbag. None of these are routine or common, but they all do have the potential to cause delays of several days or more.

All of the above is from my own research and may not be 100% accurate, but I think it presents a fairly good picture of the international airmail process. Hopefully this helps clear up how the mails work and why delivery times aren’t as straightforward as they seem.