Electromechanical instability in layered materials