Sometimes luck comes into play, but the team who takes advantage of their opportunities more than their opponent wins on that given day.
“Deserves” matters not and is a ridiculous notion to even through around. All teams in a particular contest, regardless of sport, are good enough to be in that league, competition, or tournament. The team who executed better in that contest wins. If a team has a lot of shots but are blocked by the keeper, etc...doesn’t mean they “deserve” to win. The other team out performed them and thus...they win. Deserves may be, in my opinion, one of the stupidest notions thrown around in sports.