I attempted to remove the drums on my wifes 98 jeep cherokee sport but in attempting to remove the drum, the brake shoes also were coming off and as a result the retaining pins popped out. I was able to just push everything back together/on, but the pins wont go back in the back. Is it necessary for those pins to be there? What would happen if i drove without them? I dont really understand drum brakes, so please go easy with the explanation, but from this picture it looks like its necessary that those pins are there (its connected to the hold down springs and retainers, which i assume keeps the shoe from contacting the drum??)
Important Caveat: Seeking information for future reference is admirable but it sounds like your wife's car now has at least one non-functional brake. You may be in a position where professional technical help is advisable.
Back to your question:
Your terms and the picture don't quite match. Are you talking about the "Holddown pins" in the picture?
If so, yes, it appears that those pins are a critical component. Those pins pretty clearly provide the lower fixed point on each shoe. The anchor pin on the top secures the return springs (pulling the drums back when you aren't braking). Without those lower holddown pins, it appears that the shoes would quickly be forced out of alignment (and perhaps the wheel) after one or two brake pedal applications.
Again: At this point, I would recommend involving a technician if for no other reason than you could ask them, "What went wrong here and how can I avoid that in the future?"
You are correct in that I needed the retaining pins. The reason I couldn't get the drum off was I had turn the adjuster to bring the shoes in a tad to make the drum easier to take off (they should have come off without having to do that, but there was probably a rust ring around the inside of the drum). Once I did that, the drum came off relatively easy and I was able to replace the hardware (including the holddown pins and the 'caps' that they clip into). Involving a friend who had done plenty of drum brakes helped, in addition to comparing against the other drum brake when we had it assembled. The brakes, including parking brake are fully functional and working great now. Thank you for your feedback.