Payroll serves as both an HR and a financial function. It is one of your company's overhead costs, thus it requires money. Payroll is a part of HR because it entails keeping track of items like hours worked, time-off requests, and benefits information.
Many payroll services interact with existing time and attendance software as well as HR management software.