A 401(k) is a type of qualified retirement plan created by employers, where an employee deposits money into a retirement fund and the employer matches a certain percentage of the employee's contributions. A 401(k) provides a payout at retirement that is reliant upon the total money contributed and the performance of the investment.
Most employers match employee contributions to 401(k) plans in order to attract and retain talent at their company. Most employees are very anxious about saving for retirement. Usually, if an employee has offers from different companies and all else are equal, 401(k) contribution matching could become a factor in choosing an employer.
Many employers prefer defined contribution plans instead of defined benefit plans because the former doesn't require them to decide where to invest and doesn't specify a certain amount of money to give when an employee retires. Defined contribution plans like 401(k) matching puts the onus of investing on the employee and doesn't guarantee a set payout at the end, which ultimately is more cost effective for the employer.
For related reading, check out 8 Reasons To Never Borrow From Your 401(k)and How To Cure An Ailing 401(k).
This question was answered by Chizoba Morah.