During the marriage until the date of divorce, all retirement (401(k), pension, etc.) is usually divided 50%-50%.
In order to divide these benefits, the Judge must sign a QDRO document - Qualified Domestic Relations Order that is then sent to the employer(s) who divides the employees plan.
Anything BEFORE marriage is separate property.
In Texas, since we don't have legal separation, the community property continues to grow/decrease until the date of the divorce.
FYI: However, some plans are NOT divisable. The railroad has a retirement that states they will NOT divide this benefit EVEN if ordered to do so by a court.