These are two completely different documents. They differ in the subject of filling, purpose, and deadlines for submission.
So, all new employees must complete a W-4 to calculate the employer's tax liability. Form W-2, in turn, is filled out by the employer at the end of the tax period (year) and contains information about the employee's salary and taxes. Form W-4 is completed and submitted to the employer before starting the first day of work. The employee notifies, among other things, of his marital status and the number of dependents in his W-4. Income tax tables are also built around this information.
W-2 is completed by the employer at the end of the year and contains very different information: about wages paid, tips and other compensations, and the amount of taxes withheld. Such a report must be given to the employee by January 31 to give him time to complete the tax return.