There are two types of discounts: general discount and membership discount.

general discount applies to a specific course. It is set in Advanced settings in the Pricing tool:

Course pricing advanced settings panel

Metadata fields can also be found in advanced pricing settings, where you can define what metadata to send to the payment processing provider. 

membership discount is a type of discount that applies to a specific user group, role, or organization.

For it to apply, a corresponding setting should be toggled in Advanced settings of a course (it is by default).

If a user has an overlap of membership discounts, the highest one will be applied. 

You can also disable/enable all existing membership discounts at once, or toggle each one separately.

eCommerce pricing - Discounts tab

A general discount and membership discounts can be active at the same time - they will be summarized.