When the team collaborate on what to do next, the Product Backlog will be discussed and perhaps refined further, and the Product Owner will reorder it appropriately. The backlog should be rendered in the best possible state for Sprint Planning.
The sprint review provides valuable input to product backlog maintenance (prioritization, new user stories).
The Product Backlog is the direct input into Sprint Planning Part 1. The latest Product Increment is the result of the previous sprint, and is the input to PB maintenance. Team performance is also considered as the team collaborates with the PO to craft the offer in Sprint Planning Part 1.
Team Capacity for the upcoming sprint is calculated in Sprint Planning Part 2.