How does PAYE work?
The employer registers with HMRC as an employer and gets a PAYE reference. Each pay day, payroll software works out gross pay, then the income tax and National Insurance due using the employee's tax code and HMRC's current tables, and deducts them. The employee receives the net amount and a payslip; the employer receives a bill.
On or before each pay day the employer sends HMRC a Full Payment Submission under Real Time Information, listing every employee, what they were paid and what was deducted. The deductions, plus the employer's own National Insurance on top, are paid to HMRC monthly: by the 22nd if paying electronically, which almost everyone does.
PAYE also carries other things that ride along with pay: student loan repayments, pension contributions under auto-enrolment, statutory sick and parental pay, and the cumulative tax adjustments that stop people over- or under-paying across the year. The employer is doing HMRC's collection for it, and is liable if it goes wrong.