It depends on many factors that can be mainly categorized in personal experience with the player(s), position and range:
Personal experience: Are you playing against a good player? Bad players tend to make very wonky decision, which makes it harder to make good assumptions on what they are playing. In that case, you play by the book on probabilities, because over time you will make more money. There's also "tighter" and "loser" players, who will bet more/less respectively with better or worse hands. Finally you could have a tell or a feel for a player you know for a while.
Position: Betting is highly dependend on the relative position he has at the table. Let's consider two situations, both pre-flop, with five players at the table: First situation, the person after the small blind bets a largre amount. He still has 3 people "behind" him, where he has 0 information on what they are going to do. They could re-raise him, call or fold. He puts himself in a very risky situation by handing over control to the people "that have position" on him.
Second situation, the same player makes a raise as the big blind. In this situation, everyone before him either folded or called, implying they don't have strong hands. He can use this situation to push more people out of the pot, or prepare for a larger bet on the flop. ("Preparing" in the sense that a larger pot makes it more difficult for people to fold to bets. If you have a flush draw and are supposed to pay 20€ to see the next card, the value is very different if it is a 40€ or 200€ pot).
Range: This is the trickiest and coolest part of playing poker. Basically you are trying to find out what cards your opponent holds so you can make a better decision. At the same time, you would like to conceal what cards you hold yourself. Consider the two situations from before: A large bet in second position does imply 1 thing: You probably don't want many players to join for the flop. This in return implies you have something good, that could easily get overturned if someone hits a flop. Small Pairs are very likely. In the second situation, it is much more difficult to limit your range. You are defending the big blind, so you're already invested. You are either raising for value because you have a strong hand (AK, AQ, 89 suited etc.). Or you realized no one raised so you want to "act" as if you have a strong hand, potentially steal the blinds or set yourself up for a later bluff.
Edit: I probably should've just posted Daniel Negreanu's channel, he's a much better player than I am and probably also better at explaining. https://www.youtube.com/playlist?list=PL3N4X2KgtefdYT6dGleeo...