temp files are just that, temporary and non-essential. All the processes and services that are running on your phone, both app and operating system services, will be creating, using, and discarding temp files continuously and frequently. There's no point in you fixating on why they exist, they're just a part of what goes on so your phone will be able to do stuff.