The Drugs Classification System is the system that the UK uses to ‘Classify Harms’ that drugs might cause the person using them and society. If a Drug has no medical use in the UK, even if it is used in other countries it will be illegal, so Ecstasy is a Class A drug in the UK. The classes also reflect the criminal penalties that you face, class A being the most severe.
Importantly there is a difference between simple possession and supplying a drug. If you have a drug on your person, even though it is not your drug, you can get charged for possession.