How can cannabis oil help alleviate pain?

How can cannabis oil help alleviate pain?