There's a negative Pavlovian reaction developers have every sprint when 1) "commitment" was not achieved, or 2) story points decreased. To avoid that pain, developers will pad points. This means that when things go according to plan, large sections of a sprint will have no work or people will try to appear busy.
The easiest way to avoid that gamesmanship is to not measure things that don't matter, which is all inputs. What matters is outcomes, which can be in the form of money, usage, satisfaction, etc.
I've only worked on an XP project once, but if we finished early, we either did some refactoring or pulled down another card and started on the next task.
You do need some time now and then for refactoring and that's how we did it. Not everything needs to be formally estimated and scheduled.
Story points are supposed be a tool to help management with realistic scheduling, not a way to push developers to work as fast as possible. If there's a lack of trust between engineering and management, it sounds like you have bigger problems.
> Story points are supposed be a tool to help management with realistic scheduling, not a way to push developers to work as fast as possible.
There is no empirical evidence that story points are more effective than other forms of estimation. (There's also no evidence that any form of work estimate is related to business value, which is the original criticism of measuring inputs).
Secondly, the perverse incentive around sprint boundaries exists and can create bad management practices. If management is actually looking at those estimates retroactively, it means that the team is being evaluated on the performance of their estimates, not on the timely delivery of value. If management is not looking at them--either in the long term or the short term at a sprint boundary--why bother in the first place?
Additionally, if it was routine for a team you were on to finish ahead of schedule, my guess is your teammates and/or manager was padding the estimates. In which case, we're back to what I consider a situation where both the company and employees lose because of disengagement.