On convertible laptops there is a sensor built into the device for auto screen rotate using the iio- sensor- proxy
https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
https://github.com/IGEL-Community/IGEL-Custom-Partitions/tree/master/CP_Source/Tools_Drivers/Auto_Screen_Rotation