We group things because they look similar, or they act in a similar way. Endorphins all bind to the same receptor(s). This makes everything more stable. If one of them doesn’t work the others can take over. This happens a lot in biology.