I believe these were built by a potter wasp and contained eggs. The wasp probably provisioned them with insects that it paralyzed and stuffed into the chambers before sealing them.
Opiliones sometimes do this.
Spider building her egg case. She first suspended a leaf from multiple threads of web. In this photo, she is creating the pad on which she will deposit her eggs. She will then cover the eggs with more web and probably draw the sides of the leaves together to form a little packet. She will then leave the leaf hanging with her eggs hidden in the folded leaf. The process takes an hour or two in my experience.