When a player bets at the end of the hand, he either believes that he has the best hand and he is trying to get you to commit more money to the pot before he cleans up, or he knows he doesn’t have the best hand and is trying to drive you out of the pot because if it came to a showdown, he thinks he would lose. Your job is to judge which he is doing. The answer is not always easy to fathom out, and it will be experience of the game, knowledge of what type of player your opponent is, and the betting so far on the hand, which will guide you to make the best decision.
Suffice to say that most inexperienced or intermediate players bet when they have a hand, and usually don’t bluff when they don’t. So, if your opponent bets, or raises your bet, he believes he has the best hand.
Very good players may bluff at any time and they choose their moments well so that you are never certain what is going on. They may decide to check at the end and then, when you try to make a small bet, they come in and raise you (a check-raise). Now, you don’t know whether they are bluffing or trapping you. Generally, if your opponent thinks that he holds the best hand at the end, he bets it.
A check-raise is usually a very strong move but, like all moves at poker, it can be a complete bluff. With a hand you believe to be best, if you are first to act, you may decide to check, hoping to induce another player to bet (either because he has the second best hand, or on a bluff) and then raise that bet. That will make him think: are you really good or are you bluffing him?