Before the events of the game, Bowser and his assistant, Kammy Koopa, invaded Star Haven and stole the Star Rod. They also sealed up the seven Star Spirits into cards before leaving. Bowser, excited he now has the all-powerful Star Rod, decided to test it's powers out by lifting Princess Peach's Castle from the ground and have it floating in outer space with his own castle underneath it. Bowser then bursts into Princess Peach's Castle and challenges Mario to a fight. Thanks to the Star Rod, Bowser is able to easily defeat Mario and sends him crashing out of the window back down to Earth.
Later, Bowser is surprised to hear Mario is alive and expects the Goomba King to take him out since he made the Goomba King much more bigger than usual. However, after hearing that Mario has defeated the Goomba King, Bowser decides it's time to break out the Koopa Bros. as they guard the first Star Spirit. He doesn't seem to faithful in them at first due to their carefree behavior, but Bowser changes his mind after seeing their special move in action believing they could defeat Mario. However, Bowser gets upset as none of the Koopa Bros. are keeping watch of the Star Spirit back at their fortress and they run off to make sure it doesn't get take.
Sometime after the Koopa Bros. are defeated, Bowser writes in his diary explaining his disappointment of the Koopa Bros. loss. However, Bowser then writes an important detail being the second Star Spirit is being held in Dry Dry Ruins, but isn't too worried as he knows Mario must solve the mysteries of Dry Dry Desert and decides to take a rest after writing in his diary. Peach and Twink have read all of Bowser's Diary now knowing the second Star Spirit is in Dry Dry Ruins and Twink flies off to tell Mario. However, Bowser catches Peach reading in his diary orders for her to be taken back to her room.
The first fight with Bowser is the first overall fight in the game. Bowser argubly holds back in this fight since, after activating the Star Rod, becomes invincible and his strongest attack deals 10 damage which could've took out Mario in one hit from the beginning. All Mario can do in this fight is jump on Bowser until he activates the Star Rod to end this battle very shortly.
The second fight with Bowser serves as the penultimate fight of the game. Now that Mario has the Star Beam, he can nullify Bowser's Star Rod. Bowser uses much more attacks in this fight including a poison claw attack, a stomp that can take away a random command (such as Jump or Hammer), or a highly damaging electric attack. Once Bowser has been defeated, he retreats with Princess Peach having another plan on his mind.
During the third and final fight, Bowser grows to a larger size increasing all of his stats. Most of his attacks remain the same but gains a couple of new attacks such as the light shockwave that can damage Mario's partners (except for Watt) and heal himself 30 HP. Once Bowser uses the Star Rod, the Star Beam no longer works on him and he gloats on his victory. However, Peach and Twink managed to defeat Kammy Koopa and wished well enough to empower the Star Beam into the Peach Beam. Using that, Mario is able to nullify Bowser's invincibility once more and defeat him once and for all.