The main difference is subcontracting is doing work on behalf of a third party for a company. For example if you are employed by an umbrella company working for a recruitment agency onsite in a company, that is considered subcontracting.
Contracting is when you work directly for a company/person as a non employee. For example if you are deployed directly from a Recruitment agency on a customer site on a specific contract.