Retirement tax questions

You cannot just "deposit" money into a 401(k) plan, You must be eligible to do so. Please clarify exactly what is happening.