With license management you can track the licenses installed on retired hardware and unused software installations after changes in job functions of the employee.
The only way to prevent over-purchasing of licenses is to track actual usage of each software license and identify installations that are not being used.