On his blog, Alexander Schiebel writes about knowing your players to make sure each and every one of them has fun at the table. In other words, knowing what they like and want from the game and provide it. It's indeed the gamemaster's responsibility to know what the players want from the game he is currently running, whether that is an old-school dungeon crawl, a space opera with lots of action and derring-do or a game of intrigue and conspiracies. A story should be based on the players' wants and somehow tied to their character concept. The players' involvement in the story is proportional to how deep they relate to it.
Even if the gamemaster sets a baseline ("My campaign will be about a group of fortune seekers and treasure hunters exploring lost ruins and underground temples"), the players should have a lot of leeway on how to play this type of game. One could favor combat and want to see lots of action, another could seek magic items because he wants to feel powerful, and yet a third could want to flex his creative muscles and solve puzzles. Short of asking outright, how does a gamemaster figure out what each player wants from his game? Simply by looking at their character sheets. That player created a fighter? He wants action scenes, to face oponents in battle and be the group's defender. How about that player who spent his points in Knowledge skills and Lost Artifact Lore? He wants to figure out things, to delve into the past and find powerful artifacts. A player created a courtier and has high charisma? He wants to interact with NPCs, to manipulate them, to make or break alliances, to speak for the group.
Sometimes a player will create a character that he does not want to play just because the group needs one more fighter or magic-user. Resist the urge to do that. Never force a player to play something against his will. An unhappy player will not have fun at the game table and will, possibly, drag down the campaign. Always try to accommodate the player's tastes within the context of the campaign. In my AD&D 1 ed. campaign, I even let players be assassins and half-orcs if they want. That provides an interesting element of conflict both within and without the group. Perhaps in my world, half-orcs are accepted but somewhat feared. Perhaps an assassin can find a compelling reason to associate with good characters. Strive to find what it is that the player wants from the game, give it to him and he'll be happy.
Weave stories or events around the player-characters not the other way around. Even in the most simple of stories, you can find something to hook the player. For instance, in my current Greyhawk campaign, one of the players - a fighter - was attacked by an evil cleric. The player realized the cleric was possibly wearing a magic plate mail armor. He immediately wanted to have it. He set himself that goal. As a gamemaster, it is my job to make sure it is possible for him to get the armor but also to make it difficult. That NPC will return. Perhaps the characters will hear from him again, either through his minions or in person. His story will be interwoven with that of the player-character. Perhaps he will become a recurrent villain.
But here's a crazy notion: it is also the player's responsibility to entertain the gamesmaster, to create interesting characters and play with gusto. Players should have dramatic flair or be creative. They should follow the gamemaster's hooks (after all, they are there so that the players are happy about the game). Failing that, they should set their own goals. Keep the story moving. As a gamemaster, I want to be surprised. When something happens that I was not prepared for, it is much more fun for me. It keeps me involved, trying to follow what the players are doing, to come up with things to stay one step ahead of them. Each gamemaster will be entertained in different manners. Find about yours, tell it to the players and you'll have much more fun if the players play with you, not against you.
In order to entertain the gamemaster, the players must accept his campaign premise. After all, the gamemaster also wants to play a game and a certain type of story and it won't be much fun for him if he's running a game of investigation when he would rather be playing a game of fantasy and action. The campaign premise should satisfy everyone at the table and, in order for that to happen, a certain amount of give and take must occur until everyone is happy. Then, the players must play their characters within the context of that premise, being funny, serious, dramatic, proactive, reactive, and so on, but still respecting what the gamesmaster wants to play. They should not be disruptive, accept each other's ideas and feed on each other's energy at the table to create an entertaining session.
In the end, at the table, all are responsible for the success or failure of a campaign, and it's not fair to blame just the GM or the players. I end with a quote from the Advanced Dungeons & Dragons 1st edition Player's Guide. It applies to every campaign I know of:
"There is nothing quite like a successful D8D campaign, and its success is based upon the efforts of all participants. The Dungeon Master is pivotal, of course, but the players are just as important, for they are the primary actors and actresses in the fascinating drama which unfolds before them. For that reason, their outlook and their conduct will greatly affect the flavor and tempo of the campaign. Accordingly, they should do their best to further the success of the entire undertaking."