The most straightforward adventures that typically have a "win condition" are one shots/self-contained adventures from either WoTC or 3rd Party Publishers, like Curse of Strahd, Waterdeep: Dragon Heist, etc.
However, a lot of D&D groups I've played with might have characters die, but will rarely have a group "lose". However, because every group runs things a bit differently, a different group can drastically change how the game feels.
I don’t really remember specific combat we remember the fun and stories we told, even if they’re pretty lame compared to just reading a book. But they’re our unique story.
And if I put a ton of time into D&D that looks like “3D printing terrain” or “painting miniatures” (which are cool little statues so have some inherent aesthetic value) which are also fun hobbies (in my opinion) vs “accruing lots of thin pieces of cardboard” or “number goes up on screen”.
Every group has their own style. The DM might be very strict or loose with his reading of the rules. Players could be more or less into the role playing aspect (do you have to do voices and talk in character or not). Ultimately, your character can do whatever the DM allows them to do. That might seem “unfair” but the DM is not your opponent trying to beat you, they’re telling a story with you.
There’s not really a win condition. Some groups play campaign modules which are pre-written stories the DM interprets for your group. Some make it up on the fly like an improv comedy group or nerd jazz.
Think of Lord of the Rings (both because it's a good example to make my point, and because it's the source of a lot of the inspiration for D&D). All the fellowship are independently given a vague mission to go to Rivendell. They then decide, in Rivendell, to embark on a quest to take the ring to Mordor. Consequences split them up on separate missions along the way; in a D&D game, splitting the party is poor etiquette, but it's a good example of how your immediate next steps can change in unpredictable ways. The overall journey of any given character is decided by that character based on their circumstances and personal values.
^1: Your DM can define an end goal/win condition for your campaign, though.
That's...highly variable. Page 236 of the 5th Edition Dungeon Master’s Guide addresses three valid approaches with pros and cons (nominally to the dice, but because of the role the dice play implicitly to the rules as a whole) ranging from using the rules, stats, and dice rolls for everything, to using the DM’s narrative judgment for everything, to a hybrid blended approach. (Previous editions of the rules had similar license to the same range of approaches with different framing.)
It's not exactly accurate that the DM can change the rules as you go. The DM will sometimes say you can't do x or y, but a good DM doesn't do that capriciously. When I DM, I sometimes tell players flat-out "you can't do that", but it's because they've tried to do something which isn't possible in the fictional world (like if someone says they want to jump so high they land on the moon or whatever). Most of the time, when a player says they want to do something, they should either succeed outright (because it's not actually challenging for the character to do), or the rules of the game will give a clear way to determine success/failure. It sounds like you maybe didn't have a very good DM.
One thing to consider is that the DM you have can make a massive impact on your enjoyment of the game. I'd definitely encourage you to give it another shot, maybe with a different DM that more fits what you're looking for. But then again, it's also definitely not for everyone. We've had plenty of friend come into our group and just decide it wasn't for them.
Now, whether as DM or player, I enjoy it not as a game to win, but as a story to explore. Like an interactive movie. Even when I am the author of the plot as DM, I can't predict what my players will do, and it becomes an enjoyable discovery as they force plot twists from their end.
rule breaking is a kind of error handling, to get the game on track, sometimes as a plotline, such as chaotic magic zones, it shouldnt be the rule to break the rules.
some groups have house rules, and long game history. if you were sat down in midst of a campaign thats confusing.
some people really struggle with being a dungeon master [DM], but each DM has to play to the group and keep it provocative for everyone.
whether hobbits, or eagles did it, it certainly caused a power vacuum, and the ensueing times would be the entry scenario to the next campaign.