The ergodization of the magnetic field lines imposed by the dynamic ergodic diverter (DED) in TEXTOR can lead both to confinement improvement and to confinement deterioration. The cases of substantial improvement are in resonant ways related to particular conditions in which magnetic flux tubes starting at the X points of induced islands are connected with the wall. This opening process is connected with a characteristic modification of the heat deposition pattern at the divertor target plate and leads to a substantial increase and steepening of the core plasma density and pressure. The improvement is tentatively attributed to a modification of the electric potential in the plasma carried by the open field lines. The confinement improvement bases on a spontaneous density built up due to the application of the DED and is primarily a particle confinement improvement.