Why were so few at the battle?
Scene where rebel fleet pulls back from Death Star 2 to see 27 Imperial Star Destroyers trapping them at Endor. Side note: the link for the Battle of Endor says there were 27 ISD's there, but I count 32 within this image from the movie.
Were the other 24,973 of them deployed around the galaxy? In maintenance shops getting new parts?
Was the Emperor overconfident in his navy? Or overconfident in Death Star 2?
The destroyers were there only to prevent the rebels from escaping, and it might be easier to do that with 50 or a 100 ships instead of a mere 27.
Bottom line: it would be a better trap if the Empire had brought in more firepower.
I prefer answers from canon sources instead of speculative answers.
Edit to Add: Thanks to Nat for tracking down the source of the number of Imperial Star Destroyers. The number comes from the June 1993 edition of the book, "Star Wars Imperial Sourcebook" by Greg Gorden. The number is also mentioned in the game, Star Wars Uprising.