When the battery runs low on the laptop, KDE automatically logs out the user
This is a default behavior in KDE. To disable this feature, launch the Control Center under KDE.
This will create the initial klaptop configuration file in ~/.kde/share/config/kcmlaptoprc. Afterward, launch the Control Center again. This time change the value of System State Change from Logout to None.
Note: This process must be performed everytime a new user account is created.