It depends on what kind of cake it is.
Sending decorated cakes takes a special courier. One that has cold storage units for shipping and will ship the container with as little motion as possible. The only way you can really ship a decorated cake is frozen, and the cake has to be secured to the cake board, and the cake board has to be secured to the box it will be in, and then the box placed inside the cold storage container. As long as the cake stays frozen and upright, and not dropped, it should be ok. But this is very expensive.
If it is just something like pound cake or just plain cake itself, then that can be wrapped in layers of plastic wrap, placed in a box with foam padding that fits it, and then placed inside another padded box.
If it's a bundt cake, something sturdy should be placed in the center of the cake (like a funnel) so it has some inner support. Then it should be wrapped in plastic very well. And again, placed in a padded box with paper stuffing, stiff enough so the cake doesnt move, but not so firm it crushes the cake.
I've mailed mini cakes before, and they seem to get there ok with no real problems. I've never shipped a whole, regular sized cake.
How ever you ship it, make sure you have plenty of "this side up" stickers on it, as well as "fragile" and "do not drop or crush".
Regardless, you always run the risk of your cake arriving crushed, banged up, or broken apart.