From the Super Mario Wiki
Enemy Battles are a type of course introduced in Super Mario 3D World. They are found in the first seven worlds of the game. Similar to the Enemy Courses of Super Mario Bros. 3 and New Super Mario Bros. U, the only objective of these courses is to defeat the enemies to clear it. Unlike in those games, these courses must be completed to progress through the world. Most Enemy Battles take place in small Fortress-like rooms which are decorated with coats-of-arms with a Bowser emblem, and will always grant a Green Star upon completion.