I know my question may not be specific enough to warrant a specific answer, but I am curious about why there are infantry forces assigned to ships ("marine" units) if there are already combat-proficient sailors and land-infantry units that could accomplish the same function of combat. Why is there a need for marine-type units on a ship?
This is a bit of a throughout history question, so it would be best to narrow it down. In broad strokes though there are advantages in having troops who are specialized in certain aspects of warfare, ready to deploy abroad, and under control of your branch of service.
For a lot of history in many places naval warfare consisted of mainly trying to ram an enemy ship, or board it and take it over. When it was time for boarding it helped to have people on board whose main job was exactly that. Also the distinction between a combat ship and a transport or merchant ship wasn't always very well defined. You can look at the battle of Dover for a good example of this.
At first the fighters on the ships wouldn't have been marine specialists, but as time moves on and more professionalism and specialization entered the military specific marine units emerged. The tactics and equipment used in boarding an enemy ship would be different from fighting in the field.
Additionally, from an organizational stand point it's much easier if everyone is in the same organization and chain of command. Joint Operations have issues with inter service rivalry/misunderstanding even today, and a ship would always need a contingent of marines for security, so why should they belong to some wholly separate organization?
As time went on the concept of amphibious warfare became a natural fit for marine units, and the ability to have an expeditionary force trained and equipped for such means that your country has the ability to apply land force anywhere it's navy can get to.