no, managers are not stupid, it's just that their incentives are aligned this way
to get you a raise, (s)he needs to do a lot of convincing to their boss, HR, etc - a lot of trouble, really, so they are not naturally inclined. But having offer in hand helps with the process and creates urgency, so they will do it
otoh, to fill a vacancy is most probably a streamlined process which keeps everyone busy and happy (even if its worse for the company as a whole)