In which country? I am going to assume from your previous questions that you're in the USA.
In that case, they don't all count. The president is elected by electors chosen by the states, so now we need to look at how the states choose their electors. The US constitution doesn't say anything about this, it leaves it entirely up to the states, so it's possible for a state to not hold a presidential election at all and just have the state legislature choose the electors. Which some of them did in the early days of the US. The first time all states held a presidential election was in 1868 - South Carolina was the last one not to have the people vote.
And what they all do, except for Maine and Nebraska, is choose all their electors by "winner takes all". The state votes, and who gets most votes in the state? The electors from that state will be the list that the winner's party puts up. It doesn't matter how much the winner wins by. It might be 99-1, or 51-49 - the winner still gets all the electors from that state. Maine and Nebraska break it down further by congressional district but this tends not to make much difference.
So if you're in a state that tends to always go one way, what's the point of voting? Is it worth voting Democrat in Texas? The election tends to be decided by a few "swing states" that could go either way.
Furthermore, it's done by electors because when the constitution was written, the smaller states insisted on a small bias towards them. "Doesn't just being a state count for something in a federal country?" Well, it should, and doing it by an electoral college of electors chosen by the states was the solution the writers came up with. The result is that your vote counts for more in a smaller state.
To change any of this requires an Amendment to the constitution. Nobody has thought it worth even trying for the last 230 years.
Of course it could be done by a straight nationwide vote ("the popular vote") but there are arguments against that - you'd always get the President decided by all the big cities. Maybe there are reasons for keeping it the way it is so the smaller rural states with different concerns get a bit more of a say.
Or if you want to keep the aim of the electoral college, what the US could do is require states to choose electors by proportional representation. Use something like the d'Hondt method to allocate electors to candidates according to the actual proportions of votes. You'd get a split in every state and winner doesn't take all. Your vote might be the one that gets the candidate you want one more elector from your state.
But this is all speculation while nobody seems to want to do anything about it.