Before lenders decide to give you a loan, they must know that you are willing and able to repay that loan. To assess your ability to pay back the loan, lenders assess your debt-to-income ratio. In order to calculate your willingness to pay back the loan, they look at your credit score.
Fair Isaac and Company calculated the original FICO score to assess creditworthines. We've written a lot more about FICO here.
Credit scores only consider the info contained in your credit reports. They never take into account your income, savings, down payment amount, or demographic factors like gender, race, national origin or marital status. These scores were invented specifically for this reason. "Profiling" was as bad a word when FICO scores were invented as it is today. Credit scoring was developed as a way to take into account solely that which was relevant to a borrower's likelihood to repay a loan.
Past delinquencies, payment behavior, current debt level, length of credit history, types of credit and number of credit inquiries are all considered in credit scores. Your score considers positive and negative information in your credit report. Late payments will lower your credit score, but establishing or reestablishing a good track record of making payments on time will raise your score.
To get a credit score, you must have an active credit account with a payment history of at least six months. This history ensures that there is enough information in your report to build a score. If you don't meet the criteria for getting a credit score, you may need to establish your credit history before you apply for a mortgage.