In very broad terms, the project manager is responsible for delivering the stated project objectives on time and within budget, and the business analyst makes sure that the solution matches what the organisation really needs. On a good project, they work closely together, and neither job can be done without the other.
In some cases the business analyst will be called in even before the project has started. They will advise at the strategic level and help senior staff decide what sort of project or programme will deliver what’s needed. When the project manager comes on board, their first jobs will be to scope and plan the project. This works best if done in collaboration with the business analyst, who will be starting to develop a relationship with the stakeholders which focusses on their requirements.