Well, the first thing to discuss is that you don't have just one credit score, rather you have three: Equifax, Experian, and TransUnion. Your score can vary slightly or even by tens of points between these three credit bureaus simply due to how they calculate the scores and what's reported to them, like missed payments.
There's also an agency called FICO that provides credit scores as well as VantageScore. Each one of these credit agencies calculates their scores independently, on their own scale. And lenders, like banks, can choose which scores they want to consider to evaluate you.
In general, the biggest factors that will affect your credit scores are:
The number of accounts you have in your name
The types of accounts you have - auto loans, credit cards
How much credit you're using versus how much credit you have
How long you have had credit for
Your payment history on all credit lines
The best way to think of credit scores is numerical measures of how good of an idea it would be to loan you money. If you went to a bank and asked them for $50,000 in loans, they'd need some way to evaluate how likely you will be to pay them back, other than "Yo, I'm good for it."
The weight of each variable
Each of the different variables we mentioned has different weights depending upon the formula being used, and the specifics of which are kept secret by each agency. That said, the most important factor that goes into calculating your credit score is payment history.
As you can probably guess, looking back at how well you stayed on top of making payments is a pretty good indicator of how likely you will be to make your payments on time in the future. If you apply for an auto loan, the lender might choose to weigh your auto payment history higher than say, your credit card payment history.
Stepping back for a moment to the formula for the overall score, while many agencies keep their exact formulas secret, we can at least know the weight of each category in FICO scores, since they make that data public. For FICO scores:
payment history (35%)
amounts owed (30%)
length of credit history (15%)
new credit (10%)
credit mix (10%)
What each variable means
Your payment history is simple. Have you missed payments, if so, how many? For amounts owed, lenders will look at your debt to income ratio or the ratio of how much debt you pay each month versus how much money you're bringing in. In general, you want to keep this ratio under 43% on the very high side. The lower you are, the better off you are.
The length of credit and new credit categories should be pretty self-explanatory. Do you have a good track record managing money, and have you recently started taking a bunch of new loans, signaling possible irresponsible spending.
Lastly, while not weighted heavily, lenders will also want to see a good mix of accounts. Auto lenders will want to see you have managed an auto loan before. Credit lenders will want to see good credit card history and also see that other lenders have extended your credit through cards too. It's essentially a measure of "How alone am I in giving this person money? Have other people done it? I guess if they have, then I'll do it too."
Now that we grasp how these scores are calculated, or at least what goes into each score and how that information is measured, we can understand the best way to improve credit. If you want to improve credit fast, you'll want to start with the high-value categories. Start making your payments on time, pay down your overall loans, and just start being responsible with your credit. Soon enough, your credit will start improving. Also, be sure to check your credit report for free on various websites, as it will help you track your progress and ensure no one took out a loan in your name.
So that's how the all-important credit score is calculated. It can be an unclear process since companies keep a lot of secrets, but in general, you'll see yourself up for success if you pay attention to all the categories included.