The tubes are a secure bee nursery
1Here you can see two capped tubes containing mason bee cocoons, with another tube containing a bee.
2Once the tubes have been filled with larvae, the bee caps them with mud. Leaf-cutter bees may do the same using pieces of foliage.