If you're close to victory in a fight or otherwise have an advantage, sometimes you'll get a theme playing to tell you. Can happen in all games. Especially likely in boss battles.
This serves two main purposes. First, it tells the player that he is close to victory, something that may not be immediately clear from the data on the screen, particularly with Marathon Bosses. Secondly, a good dramatic near-victory theme can get a player's blood going and make the game more exciting. This potentially makes use of a Variable Mix.
See also Songs in the Key of Panic.
Played with in NieR, where as the final battle with the Shadowlord draws to a close, the Shadowlord's dramatic theme grows quieter until a music box version of his theme plays instead, signifying his utter despair and complete loss of hope.
For every world boss and Crush Bomber battle in Bomberman Generation, once the boss' life is down to around a heart and a half the boss theme is replaced with the more upbeat battle mode theme.
Happens in Warriors Orochi when you eliminate most to all of the officers in a level except the last one, or a good number of the enemy mooks.
In Bayonetta, the bosses each has their own Ominous Latin Chanting theme, but except for one, once you beat them enough, that boss theme will be replaced with a short piano piece, which is later replaced by yet another theme when you use your Finishing Move.
Each boss in Metal Gear Rising: Revengeance has its own unique boss theme. Normally, these are pure instrumental themes, but during the final phase of each fight, or during suitably climactic moments such as slicing off one of Metal Gear Excelsus's legs, the boss theme switches to a vocal version. Played with during the second fight with Jetstream Sam, where the vocals play by default and cut out during a short interlude partway through the fight where Raiden manages to temporarily disarm him.
Tokimeki Memorial 2 has a variation of this. When trying to win the heart of Ensemble Dark HorseBroken Bird Kaori Yae, if you manage to get her to Tokimeki State and see her mandatory Event where she confesses to the male hero her painful past, allowing her to heal her heart and turn back to the Genki Girl she was, her somber, quiet Leitmotif tune will change to a more peppy, cheerful version, meaning you're on really good tracks towards getting her Happy Ending.
In Super Solvers: Gizmos & Gadgets, the background music for each race will turn into a triumphant theme if the player's vehicle is ahead of Morty's. The opposite occurs if Morty is ahead.
Age of Mythology plays one of three epic orchestral themes when you unleash a God Power (particularly fitting if you just ravaged the enemy base with an Earthquake, tore through attackers with a Tornado, or just blew up everything with a Meteor Strike)
"The Genesis" in Persona 4 is an oppressive, somber True Final Boss theme with bombastic brass and ominous drums. As the battle rages, however, a heroic reprise of "I'll Face Myself"'s main melody breaks in; eventually, the music becomes an all-out, triumphant version of "Reach Out To The Truth."
About half the final fight of Mass Effect 3 will be without music, with the screams and sounds of battle being the only things you'll hear. But then, when things get the most hairier this theme will start playing. It could be considered a Near Victory Fanfare for each side, since both armies could win at any moment (especially the enemy), and the one who wins the fight will accomplish their objectives.
The battle against Titan in Final Fantasy XIVA Realm Reborn has multiple stages, each one with its own progressively dramatic boss theme. How many stages there are depend on which version of the fight you're playing, but the final round of the fight features "Under the Weight," an intense vocal theme that nicely signposts the hardest part of the fight. Leviathan, introduced in the 2.2 patch, also has a vocal theme kick in around the halfway point of the fight.
Nearly all of the Fire Emblem games have a tune that plays when you've cleared out most of the enemies (in the GBA/DS games, its when there's only one enemy left on the map - and its often the Boss, but not always), which can get annoying if you grind for Supports.