It's changed as the job market has changed. HR used to be looked to for payroll and benefits functions. Today payroll and benefits may not even fall under human resources. Now it's more for retention, working with managers and employees to make sure people are happy. Now that the job market is tight, companies are looking at the services they're providing their employees.
HR is really the customer service for employees.
Companies are focusing on getting much smarter in terms of how they treat their employees. If they don't, there's a cost. And that cost is turnover. Whatever a company may spend on us, it's a lot cheaper than turnover.