I agree with you that Pelargir is one of the great mysteries of Lord of the Rings, however there are some clues as to what may have happened.
1. Amoung the men arriving in Minas Tirith with Imrahil were some men spared from the ships. Obviously Gondor realised that its small fleet would not be able to compete with the men of Umbar. However the fact that these men were sent tells us one of two things;
a. Pelargir sent them on because they realised there was no hope of defending the city.
b. They were sent because Pelargir was already well manned by local levies and could spare the men.
I personally favour b, as I don't belive the inhabitants would give up the city without a fight.
We should also pause to consider the city's likely defences. These were probably formidable; even if they weren't the old Numenorean walls which may have been damaged in the downfall the walls were almost certainly the ones which held off the army of Eldacar for a whole year until 1448.
Secondly the city itself would very probably have been defended from attack from the south using a metal chain with large wooden blocks. It would not have been beyond the craft of either Numenor or Gondor to make. Breaking a boom of this nature is difficult, made almost impossible by the flow of a river current. The only way to capture it would be to land and destroy the capstan heads which would certainly have been inside the walls.
My own feeling is that by the time Aragorn arrived the outer defences, including the capstans had almost certainly fallen. This would have allowed the corsairs to sail into the city and capture a large part of it. However I would be surprised if a city like Pelargir had not taken this eventuality into account. My guess is that there would have been an inner set of walls and inncer city which was not so vulnerable to being bypassed by the ships. Their fall was inevitable owing to the weight of the corsairs numbers, but might not have occurred by the time that Aragorn arrived.