Before lenders decide to give you a loan, they must know if you are willing and able to pay back that mortgage. To assess your ability to repay, they assess your income and debt ratio. To assess your willingness to repay, they use your credit score.
Fair Isaac and Company formulated the original FICO score to help lenders assess creditworthines. For details on FICO, read more here.
Your credit score comes from your history of repayment. They don't consider income or personal characteristics. Fair Isaac invented FICO specifically to exclude demographic factors. "Profiling" was as bad a word when these scores were invented as it is today. Credit scoring was invented as a way to consider solely that which was relevant to a borrower's willingness to repay a loan.
Deliquencies, derogatory payment behavior, debt level, length of credit history, types of credit and the number of inquiries are all considered in credit scores. Your score considers both positive and negative items in your credit report. Late payments count against your score, but a record of paying on time will improve it.
To get a credit score, you must have an active credit account with at least six months of payment history. This history ensures that there is enough information in your report to calculate an accurate score. Should you not meet the minimum criteria for getting a credit score, you may need to work on a credit history prior to applying for a mortgage.