The terms of the lease will usually state that each person who signs the lease is “joint and severally liable” for each of the obligations under the agreement.
In the context of landlord tenant law, joint and several liability means that if one tenant does something in violation of the lease, the co-tenants are equally responsible to the landlord.
So if one tenant doesn’t pay their fair share of the rent, the co-tenant is responsible to the landlord for the entire rent. In fact, the roommate who remains in the apartment can be evicted and sued for unpaid rent if the roommate who left does not pay their share and the remaining tenant does not make up the difference.