Football/soccer question about offsides
I know how the rule works thanks to watching Ted Lasso. But I don't understand why it exists. Watching today's US-Australia World Cup match, I see a US player break away with the ball, run to Australia's goal, but can't just kick it straight in, because the closest defender was behind him. It was just him and the goalie. So he doesn't get a shot on goal because he's faster than the defender. It doesn't make sense to me. What am I missing?
Also, how does Ted catch it in the game where no one else does? I get Beard might not, because he's still relatively new to football. But I can't imagine Roy would have missed it. When I go to a match, I almost never see it in real time. 90% of the stadium starts yelling "offside!" and I'm left waiting to see a slo mo replay.