In short, vesting applies to how much of your 401(k) balance you own or can take with you (roll over or cash out) when you leave your employer.
You always have full ownership of all of the funds that you have directly saved or rolled into a 401(k) plan. Your employer’s matching or profit-sharing contributions, on the other hand, might be subject to a vesting schedule that dictates how long you have to work at a company until you have full rights to these contributions.
If you leave your current employer before you are fully vested, you only have ownership rights over your deferral contributions as well as the portion of your employer match contribution that has vested. Vesting schedules vary by employer and plan, so you should check your Summary Plan Description (SPD) for your plan’s specific schedule.