Free-riding is stricter than a good-faith-violation: there were never sufficient funds for the purchase at all. Regulation T requires a 90-day freeze in which the account may only buy with fully settled cash held before the order.
It typically happens by accident, when a trader assumes a deposit has arrived or misreads available versus settled cash.
Example: an account holds $500 settled. A buy for $6,000 is accepted on the assumption a wire will land. It does not. The trader sells at $6,400 the next day and pays for the original purchase with the proceeds. That is free-riding, and the account is frozen for 90 days regardless of the $400 profit.
Related: good-faith-violation, cash-account, unsettled-funds, regulation-t