A nation can capture new ports through a Port Battle. To capture a port, a player has to buy a Conquest Flag(which weighs 100 tons so it is limited for certain ships) for that port from on of the ports belonging to the players Nation. The Conquest Flag can only be used to a port which it was bought for. To start a Port Battle, you bring the Conquest Flag to the enemy port.
Conquest Flags last only 60 minutes and immediately after buying a Conquest Flag, there is a announcement to the entire server that you bought a Conquest Flag against that Port (Creating an Assault Fleet broadcast). If you win the Port Battle, the port is then captured and after Maintenance hours the port changes owner. If you lose the Port Battle, the Conquest Flag is used and you need to buy a new one to try to conquer the port again, do note however that there is a 3 hour cool down if you failed.
Capturing new ports is beneficial to a nation, because of increased resource production from the port and bringing new trade routes.