Depends on what rules you play by.
2nd-Edition rules were “Naval Occupation”. That is, an IC could not produce naval units if the sdjacent SZ(s) were enemy-occupied. You could build them on Purchase Units Phase, but unless the waters were cleared of enemy units, the naval units could not be placed & were lost!
3rd-Edition rules are “No Naval Occupation”. In this case, newly purchased naval units can be placed in enemy-occupied SZs. Unless the enemy moves out or is destroyed before his or her Combat Phase, a battle occurs between your naval units & theirs…
Which brings us to a conundrum I haven’t yet solved. Say you place new naval units onto an enemy-occupied SZ. Now what if on your ally’s turn, he or she attacks the enemy units in said SZ? Are your units allowed to join the fight as an “allied force”, or are your units considered to be “not involved”? I’ve always wondered about this…
Ozone27