The contingency fee you reference is known as the Due Diligence fee in NC, which is the fee you pay the seller to inspect a property upon contract commencement. You are giving the seller X amount of funds to "buy time" to inspect the property for a set period of time. During the Due Diligence period you are able to walk away from the contract at anytime, for any reason, but you forfeit your Due Diligence fee if you opt to terminate the contract. So, the Due Diligence fee should be no more than the amount your are comfortable losing if property inspections uncover something that would be considered a deal breaker for you. On the other hand, the Due Diligence fee is applied to the purchase price if you proceed with the purchase.
NC has 2 options for earnest money... Earnest Money and Additional Earnest Money. The primary difference is that Earnest Money is due upon contract commencement whereas Additional Earnest Money is due at a date you select, later in the contract period (typically after the Due Diligence period). Earnest Money, for lack of a better explanation, is your GOOD FAITH money, more or less telling the seller you're serious and you'll follow through with the terms of the contract. Earnest Money is refundable unless you terminate the contract after the Due Diligence period. So, if Due Diligence ends on Wednesday, but you terminate the contract on Thursday you would lose both your Due Diligence fee and Earnest Money. Like the Due Diligence fee, the Earnest Money is also applied to the purchase price.
While neither a Due Diligence fee or Earnest Money is required in NC, I would go out on a limb and say 99.9% of all transactions involve them as it protects the seller by providing consideration 1) for giving the buyer time to inspect the property and 2) if the buyer were to terminate the contract.
While the amounts of both the Due Diligence fee and Earnest Money are negotiable, a lot of different factors play into determining the amounts one would offer... which is a totally separate discussion.