The million dollar question with just as many answers. I believe a famous example is The Lord of the Rings, Tolkien writing "Strider" in for the bar encounter though not entirely sure who he was going to develop his character into. However, like GRRM and Song of Ice and Fire, a very, very general outline of the plot had been established. But "general" is the key word, because what might seem to us as important specifics, like certain battles and characters, might not be a part of that "general". GRRM has always said that he's confident with the end point of his ASOIAF, he knows the conclusion to the story, but the actual road to it happens on the fly.
Video games, or any expensive medium for that matter, are particularly different because what we expect from a good, true trilogy isn't necessarily what is going to be a reality. Tolkien was confident (or confirmed) in security to write all three chapters of The Lord of the Rings. It didn't matter how Fellowship ended in the grand scheme of things, as long as it ended the first act. We can satisfying sit with the Fellowship haven broken up the various groups heading off with knew goals even though the main narrative, the core theme, that being the return of a great evil, hadn't yet been resolved. It's okay the ring exists, and it's okay to end the story that way, because two more books are already in the pipeline.
I said this in another thread, but the video game industry is very difficult at times, especially securing financial support to see a game through to its intended vision. The industry as a whole is still pretty juvenile and going through a lot of growing pains. Fact of the matter is no matter how planned the trilogy was, BioWare could never have made Mass Effect with the Tolkien-like security of two more games coming out for sure. They didn't know how the development of Mass Effect would actually go, how much it would cost in the long run, and what troubles they'd run into. They didn't know how well it would sell. And so they couldn't know if Mass Effect 2 and 3 would exist at all, let alone fit some vision. What if Mass Effect tanked? What if Microsoft or EA or BioWare went under or someone was sold off to someone else? What if rights to the franchise were caught in legal disputes? What if the publisher caused a difficult working relationship with BioWare due to wanting things done with any of the one games that BioWare didn't want to do?
How do you plan and complete a trilogy the same way Tolkien completed his when you don't even know if you'll truly finish the first game?
So again, this is why I feel Mass Effect ends the way it does, and is structured the way it is. Hypothetically it tanked and no publisher was interested in picking up the franchise. Despite being a trilogy we only get one game, yet the narrative arc while open to future games still ends on a surprisingly satisfying note. We don't end with our heroes separated and on an even more dangerous journey than they started, the enemy regrouping and more powerful than ever before, the greatest threat to the narrative, the antagonist itself, still lingering and threatening existence for all the we love. We end with our hero branded as such, the enemy's nefarious plan crushed in a thrilling climax, several plot threads having come to conclusion, with no clear vision of how the remaining enemy will be able to respond, if at all. You could end it there and be happy, or you could take it further.
As a side, this is why you should always be wary of "planned trilogy" for any expensive, AAA, blockbuster gaming franchise. It's a lot of money, a lot of risks, and a lot of important variables that can easy derail any "plans" for the trilogy the creative team might have.
EDIT: holy crap wall of text