The customer hasn't created an account
Customers who check out as guests do not earn credit for their purchases. They must create an account by signing up and adding a password.
The customer hasn't been opted into an "opt-in" loyalty program
If you're running an opt-in loyalty program and the customer has not been opted in by someone on your team, then they won't earn credit for their purchases.