If you expect to win a match, you'll do better than if you don't expect to win. It's as simple as that. You may go into the match knowing it'll be the fight of your life, but if you expect to win it, you'll have a much better chance of doing so. Even against a player who is so much stronger that you objectively have little chance, you'll do better if you expect to win, and will have the proper mindset to figure out what you need to work on so you can do even better next time.
Of course, we've all had that experience of playing someone who was much better, i.e. a "top player." But if you are practicing regularly and are about to play a "top player," ask yourself this: Are you practicing regularly to not be a top player? Hopefully not, in which case you are practicing to be a top player. So when you play a top player, it's your chance to be what you practice to be. ("Top player" is, of course relative, depending on your own perspective and goals; to some, that's a world-class player, to others it's the neighborhood or club champ.)
Here's a simple test. If when you lose a match you don't have a few seconds of disbelief that you lost, then you didn't really expect to win. This should happen even after you play a top player. If it doesn't happen, you didn't expect to win, and you are handicapping yourself both now and in the future.
Part of expecting to win for improving players is having confidence that even if you lose, you'll figure out what you need to do so you'll win next time, i.e. you may lose now, but fully expect to win next time. Here's another test. If after a match you think, "I would have won if not for [I couldn't return his serve, I missed my first attacks, I couldn't block his loop, etc.], then you have pretty much accepted your current level. If you are trying to improve, instead you should be thinking, "I can beat him next time because I will improve my [return of serve, learn to do the serve I had trouble with so I can win with it too, work on my first attack, work on my block, learn to loop so the other guy has as much trouble with my loop as I did with his, etc.]."
Often the root cause of a player not expecting to win is because the opponent does something so much better that the player thinks he can't compete. Never compare your opponent's best shot to yours; of course anyone near your level will do some things better than you, often much better in fact. But the same applies to you - against your peers, you also do something much better. Your goal is to find ways to tactically dominate more with your strengths more than they do with theirs - and expect to win as a result.
Expecting to win is a mindset you need to develop if you want to maximize your performance both now and in the future. It involves psychological, tactical, and strategic thinking. Psychological thinking is the confidence that you can win and so expect to win. Tactical thinking is thinking about your tactics so as to realize your expectations of winning. Strategic thinking is thinking about what you need to improve in your game so as to meet your expectations of winning next time. Use all three types of thinking and your expectations of winning will likely become a reality.