When we sit down to analyze Buffy's strategy, or lack of it, in that last battle, the first and most important factor is her fighting force and just what she can accomplish with it. She has two truly experienced demon fighters whose skill, bravery, and levelheadedness in battle are beyond doubt: Spike and Spike. She doesn't just want them with her, she HAS TO HAVE them there, because that is where the actual battle will be fought. Sure, she hopes that her plan to activate all of the Potentials will work, but even if it is successful, just about all that she has is a bunch of super powered amateurs with practically no combat experience whatsoever, and who are almost certainly going to need time adjusting to their new strength and agility, and, guess what, they aren't going to have that time. This is the literal trial by fire.
The people left outside to cover the escape routes were simply what she could spare from the main battle, and also the ones who most likely would have been the the first ones killed if they had gone down into the hellmouth. Keeping them outside was actually allowing them the best chance to survive. How she chose to pair up with whom makes pretty good sense if you look at it properly. Giles and Robin had become friends over the previous few weeks, and would almost certainly work well together. Buffy wanted someone who she had faith in and who she could trust to take care od Dawn, and her obvious choice was Xander. By simple process of elimination, that left her with Anya and Andrew as her final team. As for how Anya suddenly became such a skilled fighter, she probably just retained her demonic fighting skills the same way that Xander retained his military expertise after being turned into G I Joe back in Season 2.
The real question is, why did Anya retain her fighting skills in Season 7, when she apparently didn't earlier?