When you give someone the benefit of the doubt, you're choosing to trust their word even if you're not quite sure they're telling the truth.
This phrase is typically used when you don't have solid proof that a person is honest and trustworthy. After all, if you didn't have some doubt, you wouldn't be able to benefit them by accepting their word. Trusting someone is always a little bit of a gamble, but sometimes that gamble is more risky than others, and giving someone the benefit of the doubt is like saying "I know this gamble is on the risky side, but I'm choosing to trust anyway."