They are for whatever you can dream up. I’ve seen them used to extend the sides up for carrying hay or other light, bulky item. I’ve seen them used to anchor a couch. I’ve seen small toolboxes hanging from them. Bed toolboxes also sometimes have posts for them.
Me and my dad fabricated a chemical sprayer arm that sits in them, for spraying ditches, fencelines, and other small areas. We also made a seat hanging on the outside for use with a hand held spray nozzle for the same purpose.
I think they were originally intended for side rails and bed boxes, though new boxes just use clamps. They are still there just because people who actually use trucks can usually find a use for them, even if its something as simple as storing a handy tool.