C&B (Compensation and Benefits) is part of HR, and is responsible for setting policies around comp and benefits.
Payroll is the distinct practice of paying people. Payroll is often a Finance function.
In very small businesses, C&B and Payroll may be handled by the same person (i.e. an owner), but as a business grows these functions historically get split. C&B usually continues to be part of an owner/president’s responsibility until HR staff are hired, while Payroll is often moved to a financial / clerical person early on.
With modern payroll and HCM software, this line is often blurred, so HR staff may also perform payroll duties, but payroll-focused personnel would rarely perform C&B functions.