Power Automate can be used to perform the heavy processing that you wouldn't necessarily want to do within PowerApps. PowerApps needs to be lightweight and responsive to the end user, so you will need to pass data to Flow. You may also need to use Flow to perform actions to get data, such as calling REST APIs, which is something you can't do within PowerApps.
There are some key scenarios where Flow steps up to allow us to do some advanced processing with PowerApps. One of those key scenarios is the ability to handle files – being able to create, update, copy, and move files – depending on where we want our data to reside. A key use case is being able to take a picture that has been captured by PowerApps and save it within SharePoint, which requires some additional processing by Microsoft Power Automate. We can't just do this using the Create file action within the SharePoint connector since the data isn't stored correctly...