According to my BC Plant Field Guide, the spiny part at the end of the stems (pseudocephalium) is an indicator of sexual maturity because all of the flowers and fruits appear in this area.
Apparently not all, as Thijs has observed.
The pollinators in habitat are supposed to be bats and insects.
There is a dedicated pollinator called the senita moth (Upiga virescens) in the Sonoran Desert which may account for 75-90% of the pollination, depending on the year and location. This mutualistic situation is somewhat similar to the yucca's relationship with the yucca moth.
More info here.
https://www.ncbi.nlm.nih.gov/p...
The fruit has also been eaten by humans, but is not supposed to be particularly delicious compared to other cactus fruit in the area, like Stenocereus thurberi.